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

Commit 6577cae4 authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed when the notification effects are being cleared

Previously the notification effects were not correctly cleared in certain
cases and the user could end up in a state where the notification light would
always blink.

Bug: 22931139
Change-Id: I9a71e56cf4479354a9d773b5b6f0edd7693f2b05
parent e7078e18
Loading
Loading
Loading
Loading
+6 −4
Original line number Original line Diff line number Diff line
@@ -1632,11 +1632,13 @@ public abstract class BaseStatusBar extends SystemUI implements
    protected void handleVisibleToUserChanged(boolean visibleToUser) {
    protected void handleVisibleToUserChanged(boolean visibleToUser) {
        try {
        try {
            if (visibleToUser) {
            if (visibleToUser) {
                boolean clearNotificationEffects = !isPanelFullyCollapsed() &&
                boolean pinnedHeadsUp = mHeadsUpManager.hasPinnedHeadsUp();
                    (mShowLockscreenNotifications ||
                boolean clearNotificationEffects =
                        (mState == StatusBarState.SHADE || mState == StatusBarState.SHADE_LOCKED));
                    ((mShowLockscreenNotifications && mState == StatusBarState.KEYGUARD) ||
                            (!pinnedHeadsUp && (mState == StatusBarState.SHADE
                                    || mState == StatusBarState.SHADE_LOCKED)));
                int notificationLoad = mNotificationData.getActiveNotifications().size();
                int notificationLoad = mNotificationData.getActiveNotifications().size();
                if (mHeadsUpManager.hasPinnedHeadsUp() && isPanelFullyCollapsed())  {
                if (pinnedHeadsUp && isPanelFullyCollapsed())  {
                    notificationLoad = 1;
                    notificationLoad = 1;
                } else {
                } else {
                    MetricsLogger.histogram(mContext, "note_load", notificationLoad);
                    MetricsLogger.histogram(mContext, "note_load", notificationLoad);
+3 −6
Original line number Original line Diff line number Diff line
@@ -3661,12 +3661,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        // down on the lockscreen), clear notification LED, vibration,
        // down on the lockscreen), clear notification LED, vibration,
        // ringing.
        // ringing.
        // Other transitions are covered in handleVisibleToUserChanged().
        // Other transitions are covered in handleVisibleToUserChanged().
        if (state != mState && mVisible && state == StatusBarState.SHADE_LOCKED) {
        if (state != mState && mVisible && (state == StatusBarState.SHADE_LOCKED
            try {
                || (state == StatusBarState.SHADE && isGoingToNotificationShade()))) {
                mBarService.clearNotificationEffects();
            clearNotificationEffects();
            } catch (RemoteException e) {
                // Ignore.
            }
        }
        }
        mState = state;
        mState = state;
        mGroupManager.setStatusBarState(state);
        mGroupManager.setStatusBarState(state);