Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 91cf049f authored by Mike Lockwood's avatar Mike Lockwood Committed by Android Git Automerger
Browse files

am 76e4fa19: Merge "Only pulse notification light if a new notification has...

am 76e4fa19: Merge "Only pulse notification light if a new notification has been received since the screen was last turned off" into gingerbread

Merge commit '76e4fa19' into gingerbread-plus-aosp

* commit '76e4fa19':
  Only pulse notification light if a new notification has been received since the screen was last turned off
parents f49b052d 76e4fa19
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -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;
@@ -1093,6 +1097,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
@@ -1100,11 +1109,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;