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

Commit ccd14fbc authored by Selim Cinek's avatar Selim Cinek
Browse files

Reset the notification expanded states on screen off

To avoid having expanded notifications sticking around

Bug: 16005498
Change-Id: Ib5b184fa7eb67ada85305e7ca4afad68a1514327
parent 1584609f
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -150,6 +150,11 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
        logExpansionEvent(true, wasExpanded);
    }

    public void resetUserExpansion() {
        mHasUserChangedExpansion = false;
        mUserExpanded = false;
    }

    public boolean isUserLocked() {
        return mUserLocked;
    }
+12 −1
Original line number Diff line number Diff line
@@ -113,7 +113,6 @@ import com.android.systemui.R;
import com.android.systemui.doze.DozeService;
import com.android.systemui.keyguard.KeyguardViewMediator;
import com.android.systemui.qs.QSPanel;
import com.android.systemui.qs.QSTile;
import com.android.systemui.statusbar.ActivatableNotificationView;
import com.android.systemui.statusbar.BaseStatusBar;
import com.android.systemui.statusbar.CommandQueue;
@@ -2923,6 +2922,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
                notifyHeadsUpScreenOn(false);
                finishBarAnimations();
                stopNotificationLogging();
                resetUserExpandedStates();
            }
            else if (Intent.ACTION_SCREEN_ON.equals(action)) {
                mScreenOn = true;
@@ -2951,6 +2951,17 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        }
    };

    private void resetUserExpandedStates() {
        ArrayList<Entry> activeNotifications = mNotificationData.getActiveNotifications();
        final int notificationCount = activeNotifications.size();
        for (int i = 0; i < notificationCount; i++) {
            NotificationData.Entry entry = activeNotifications.get(i);
            if (entry.row != null) {
                entry.row.resetUserExpansion();
            }
        }
    }

    @Override
    protected void dismissKeyguardThenExecute(final OnDismissAction action) {
        if (mStatusBarKeyguardViewManager.isShowing()) {