mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-30 05:02:26 -05:00
. New email notification now includes purple blicking LED
This commit is contained in:
parent
1e67bbee6b
commit
081cb8f76d
@ -105,6 +105,21 @@ public class Email extends Application {
|
||||
*/
|
||||
public static final int WAKE_LOCK_TIMEOUT = 30000;
|
||||
|
||||
/**
|
||||
* LED color used for the new email notitication
|
||||
*/
|
||||
public static final int NOTIFICATION_LED_COLOR = 0xffff00ff;
|
||||
|
||||
/**
|
||||
* Time the LED is on when blicking on new email notification
|
||||
*/
|
||||
public static final int NOTIFICATION_LED_ON_TIME = 500;
|
||||
|
||||
/**
|
||||
* Time the LED is off when blicking on new email notification
|
||||
*/
|
||||
public static final int NOTIFICATION_LED_OFF_TIME = 500;
|
||||
|
||||
/**
|
||||
* Called throughout the application when the number of accounts has changed. This method
|
||||
* enables or disables the Compose activity, the boot receiver and the service based on
|
||||
|
@ -201,11 +201,16 @@ public class MailService extends Service {
|
||||
vibrate = account1.isVibrate();
|
||||
if (account1.isNotifyRingtone()) ringtone = account1.getRingtone();
|
||||
}
|
||||
notif.defaults = Notification.DEFAULT_LIGHTS;
|
||||
|
||||
notif.sound = TextUtils.isEmpty(ringtone) ? null : Uri.parse(ringtone);
|
||||
if (vibrate) {
|
||||
notif.defaults |= Notification.DEFAULT_VIBRATE;
|
||||
}
|
||||
notif.flags |= Notification.FLAG_SHOW_LIGHTS;
|
||||
notif.ledARGB = Email.NOTIFICATION_LED_COLOR;
|
||||
notif.ledOnMS = Email.NOTIFICATION_LED_ON_TIME;
|
||||
notif.ledOffMS = Email.NOTIFICATION_LED_OFF_TIME;
|
||||
|
||||
notifMgr.notify(1, notif);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user