diff options
author | Mike Lockwood <lockwood@android.com> | 2010-09-09 09:48:08 -0400 |
---|---|---|
committer | Mike Lockwood <lockwood@android.com> | 2010-09-09 09:48:08 -0400 |
commit | 2117f6fa3880e55e6a90fbd8b3a12d469c9b738b (patch) | |
tree | 7b7a054ea3306a8b93a7354e3b995a453c7df152 | |
parent | f6936a3a52b6bb6de27f75d4e38d116e896b7f4d (diff) | |
download | frameworks_base-2117f6fa3880e55e6a90fbd8b3a12d469c9b738b.zip frameworks_base-2117f6fa3880e55e6a90fbd8b3a12d469c9b738b.tar.gz frameworks_base-2117f6fa3880e55e6a90fbd8b3a12d469c9b738b.tar.bz2 |
Only pulse notification light if a new notification has been received since the screen was last turned off
BUG: 2980248
Change-Id: I4dca527a191fae4ad87eeff8ad32594fd6aeb417
Signed-off-by: Mike Lockwood <lockwood@android.com>
-rwxr-xr-x | services/java/com/android/server/NotificationManagerService.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java index 63325dd..0a5b72b 100755 --- a/services/java/com/android/server/NotificationManagerService.java +++ b/services/java/com/android/server/NotificationManagerService.java @@ -112,6 +112,10 @@ public class NotificationManagerService extends INotificationManager.Stub 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; // for adb connected notifications private boolean mAdbNotificationShown = false; @@ -1082,6 +1086,11 @@ public class NotificationManagerService extends INotificationManager.Stub mBatteryLight.turnOff(); } + // 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 @@ -1089,11 +1098,14 @@ 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 (mLedNotification == null || mScreenOn || mInCall) { + if (!mPendingPulseNotification || mScreenOn || mInCall) { mNotificationLight.turnOff(); } else { int ledARGB = mLedNotification.notification.ledARGB; |