1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-13 21:15:08 -05:00

First pass at getting a blinky LED that's the account's color

This commit is contained in:
Jesse Vincent 2010-05-12 03:06:11 +00:00
parent 093d65513a
commit e77729cb2d
2 changed files with 9 additions and 18 deletions

View File

@ -184,14 +184,8 @@ public class K9 extends Application
public static final int BOOT_RECEIVER_WAKE_LOCK_TIMEOUT = 60000; public static final int BOOT_RECEIVER_WAKE_LOCK_TIMEOUT = 60000;
/** /**
* LED color used for the new email notitication * Time the LED is on when blinking on new email notification
*/
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; public static final int NOTIFICATION_LED_ON_TIME = 500;
@ -201,16 +195,13 @@ public class K9 extends Application
public static final int NOTIFICATION_LED_OFF_TIME = 2000; public static final int NOTIFICATION_LED_OFF_TIME = 2000;
public static final boolean NOTIFICATION_LED_WHILE_SYNCING = false; public static final boolean NOTIFICATION_LED_WHILE_SYNCING = false;
public static final int NOTIFICATION_LED_DIM_COLOR = 0x77770077;
public static final int NOTIFICATION_LED_FAST_ON_TIME = 100; public static final int NOTIFICATION_LED_FAST_ON_TIME = 100;
public static final int NOTIFICATION_LED_FAST_OFF_TIME = 100; public static final int NOTIFICATION_LED_FAST_OFF_TIME = 100;
public static final int NOTIFICATION_LED_SENDING_FAILURE_COLOR = 0xffff0000; public static final int NOTIFICATION_LED_SENDING_FAILURE_COLOR = 0xffff0000;
// Must not conflict with an account number // Must not conflict with an account number
public static final int FETCHING_EMAIL_NOTIFICATION_ID = -4; public static final int FETCHING_EMAIL_NOTIFICATION = -5000;
public static final int FETCHING_EMAIL_NOTIFICATION_MULTI_ACCOUNT_ID = -1;
public static final int FETCHING_EMAIL_NOTIFICATION_NO_ACCOUNT = -2;
public static final int CONNECTIVITY_ID = -3; public static final int CONNECTIVITY_ID = -3;

View File

@ -4128,12 +4128,12 @@ public class MessagingController implements Runnable
if (K9.NOTIFICATION_LED_WHILE_SYNCING) if (K9.NOTIFICATION_LED_WHILE_SYNCING)
{ {
notif.flags |= Notification.FLAG_SHOW_LIGHTS; notif.flags |= Notification.FLAG_SHOW_LIGHTS;
notif.ledARGB = K9.NOTIFICATION_LED_DIM_COLOR; notif.ledARGB = account.getChipColor();
notif.ledOnMS = K9.NOTIFICATION_LED_FAST_ON_TIME; notif.ledOnMS = K9.NOTIFICATION_LED_FAST_ON_TIME;
notif.ledOffMS = K9.NOTIFICATION_LED_FAST_OFF_TIME; notif.ledOffMS = K9.NOTIFICATION_LED_FAST_OFF_TIME;
} }
notifMgr.notify(K9.FETCHING_EMAIL_NOTIFICATION_ID, notif); notifMgr.notify(K9.FETCHING_EMAIL_NOTIFICATION - account.getAccountNumber(), notif);
} }
try try
{ {
@ -4143,7 +4143,7 @@ public class MessagingController implements Runnable
{ {
if (account.isShowOngoing()) if (account.isShowOngoing())
{ {
notifMgr.cancel(K9.FETCHING_EMAIL_NOTIFICATION_ID); notifMgr.cancel(K9.FETCHING_EMAIL_NOTIFICATION - account.getAccountNumber());
} }
} }
} }
@ -4234,12 +4234,12 @@ public class MessagingController implements Runnable
if (K9.NOTIFICATION_LED_WHILE_SYNCING) if (K9.NOTIFICATION_LED_WHILE_SYNCING)
{ {
notif.flags |= Notification.FLAG_SHOW_LIGHTS; notif.flags |= Notification.FLAG_SHOW_LIGHTS;
notif.ledARGB = K9.NOTIFICATION_LED_DIM_COLOR; notif.ledARGB = account.getChipColor();
notif.ledOnMS = K9.NOTIFICATION_LED_FAST_ON_TIME; notif.ledOnMS = K9.NOTIFICATION_LED_FAST_ON_TIME;
notif.ledOffMS = K9.NOTIFICATION_LED_FAST_OFF_TIME; notif.ledOffMS = K9.NOTIFICATION_LED_FAST_OFF_TIME;
} }
notifMgr.notify(K9.FETCHING_EMAIL_NOTIFICATION_ID, notif); notifMgr.notify(K9.FETCHING_EMAIL_NOTIFICATION - account.getAccountNumber(), notif);
} }
try try
{ {
@ -4249,7 +4249,7 @@ public class MessagingController implements Runnable
{ {
if (account.isShowOngoing()) if (account.isShowOngoing())
{ {
notifMgr.cancel(K9.FETCHING_EMAIL_NOTIFICATION_ID); notifMgr.cancel(K9.FETCHING_EMAIL_NOTIFICATION - account.getAccountNumber());
} }
} }
} }
@ -4495,7 +4495,7 @@ public class MessagingController implements Runnable
} }
notif.flags |= Notification.FLAG_SHOW_LIGHTS; notif.flags |= Notification.FLAG_SHOW_LIGHTS;
notif.ledARGB = K9.NOTIFICATION_LED_COLOR; notif.ledARGB = account.getChipColor();
notif.ledOnMS = K9.NOTIFICATION_LED_ON_TIME; notif.ledOnMS = K9.NOTIFICATION_LED_ON_TIME;
notif.ledOffMS = K9.NOTIFICATION_LED_OFF_TIME; notif.ledOffMS = K9.NOTIFICATION_LED_OFF_TIME;
notif.audioStreamType = AudioManager.STREAM_NOTIFICATION; notif.audioStreamType = AudioManager.STREAM_NOTIFICATION;