From 081cb8f76d974c36059ac3ea4fcbdf8c23582540 Mon Sep 17 00:00:00 2001 From: Bao-Long Nguyen-Trong Date: Fri, 19 Dec 2008 19:46:47 +0000 Subject: [PATCH] . New email notification now includes purple blicking LED --- src/com/android/email/Email.java | 15 +++++++++++++++ src/com/android/email/service/MailService.java | 7 ++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/com/android/email/Email.java b/src/com/android/email/Email.java index 4a36f8d86..625eb630c 100644 --- a/src/com/android/email/Email.java +++ b/src/com/android/email/Email.java @@ -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 diff --git a/src/com/android/email/service/MailService.java b/src/com/android/email/service/MailService.java index 4a7c26874..8fcb7e101 100644 --- a/src/com/android/email/service/MailService.java +++ b/src/com/android/email/service/MailService.java @@ -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); }