From b0626b53adceb3de0b85c1865655e74e7e964e08 Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Tue, 23 Aug 2011 15:11:04 -0400 Subject: [PATCH] No longer disable notification lights when screen turns on The new specification calls for LED to continue blinking until the user pulls down the notification shade in the status bar. Bug: 5143247 Change-Id: Id004cc3d1d9d76108329e57c6fbd8a8100068e0a Signed-off-by: Mike Lockwood --- .../server/NotificationManagerService.java | 24 ++----------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java index 6edb132eb73c9..7a3a344c0a760 100755 --- a/services/java/com/android/server/NotificationManagerService.java +++ b/services/java/com/android/server/NotificationManagerService.java @@ -101,13 +101,8 @@ public class NotificationManagerService extends INotificationManager.Stub private Vibrator mVibrator = new Vibrator(); // for enabling and disabling notification pulse behavior - private boolean mScreenOn = true; private boolean mInCall = false; private boolean mNotificationPulseEnabled; - // This is true if we have received a new notification while the screen is off - // (that is, if mLedNotification was set while the screen was off) - // This is reset to false when the screen is turned on. - private boolean mPendingPulseNotification; private final ArrayList mNotificationList = new ArrayList(); @@ -349,12 +344,6 @@ public class NotificationManagerService extends INotificationManager.Stub cancelAllNotificationsInt(pkgName, 0, 0, !queryRestart); } } - } else if (action.equals(Intent.ACTION_SCREEN_ON)) { - mScreenOn = true; - updateNotificationPulse(); - } else if (action.equals(Intent.ACTION_SCREEN_OFF)) { - mScreenOn = false; - updateNotificationPulse(); } else if (action.equals(TelephonyManager.ACTION_PHONE_STATE_CHANGED)) { mInCall = (intent.getStringExtra(TelephonyManager.EXTRA_STATE).equals(TelephonyManager.EXTRA_STATE_OFFHOOK)); updateNotificationPulse(); @@ -1059,11 +1048,6 @@ public class NotificationManagerService extends INotificationManager.Stub // lock on mNotificationList private void updateLightsLocked() { - // clear pending pulse notification if screen is on - if (mScreenOn || mLedNotification == null) { - mPendingPulseNotification = false; - } - // handle notification lights if (mLedNotification == null) { // get next notification, if any @@ -1071,14 +1055,10 @@ public class NotificationManagerService extends INotificationManager.Stub if (n > 0) { mLedNotification = mLights.get(n-1); } - if (mLedNotification != null && !mScreenOn) { - mPendingPulseNotification = true; - } } - // we only flash if screen is off and persistent pulsing is enabled - // and we are not currently in a call - if (!mPendingPulseNotification || mScreenOn || mInCall) { + // Don't flash while we are in a call + if (mLedNotification == null || mInCall) { mNotificationLight.turnOff(); } else { int ledARGB = mLedNotification.notification.ledARGB;