1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-08-13 17:03:48 -04:00

. New email notification now includes purple blicking LED

This commit is contained in:
Bao-Long Nguyen-Trong 2008-12-19 19:46:47 +00:00
parent 1e67bbee6b
commit 081cb8f76d
2 changed files with 21 additions and 1 deletions

View File

@ -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

View File

@ -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);
}