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

Commit f4659b2b authored by Roman Birg's avatar Roman Birg
Browse files

SystemUI: fix empty notification space in shade_locked



In 8e98622a, we started
funneling update notification calls through the handler
to avoid queueing up hundreds of these calls if a
notification became spammy and to only execute one update if many were
queued.

However, some animations and state transitions are expecting the action
to be done immediately after the call. Facilitate these requests by
allowing them to bypass the handler if they want.

Change-Id: Ice14cdaf93a4d370779b4a3e8996d17cd42fdff8
Signed-off-by: default avatarRoman Birg <roman@cyngn.com>
parent 345bb384
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1835,7 +1835,7 @@ public abstract class BaseStatusBar extends SystemUI implements
    protected void setZenMode(int mode) {
        if (!isDeviceProvisioned()) return;
        mZenMode = mode;
        updateNotifications();
        updateNotifications(true);
    }

    // extended in PhoneStatusBar
@@ -1857,7 +1857,10 @@ public abstract class BaseStatusBar extends SystemUI implements

    protected abstract void haltTicker();
    protected abstract void setAreThereNotifications();
    protected abstract void updateNotifications();
    protected void updateNotifications() {
        updateNotifications(false);
    }
    protected abstract void updateNotifications(boolean immediate);
    protected abstract void tick(StatusBarNotification n, boolean firstTime);
    protected abstract void updateExpandedViewPos(int expandedPosition);
    protected abstract boolean shouldDisableNavbarGestures();
+10 −5
Original line number Diff line number Diff line
@@ -2032,11 +2032,16 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
    }

    @Override
    protected void updateNotifications() {
    protected void updateNotifications(boolean immediate) {
        if (immediate) {
            mHandler.removeMessages(MSG_UPDATE_NOTIFICATIONS);
            handleUpdateNotifications();
        } else {
            if (!mHandler.hasMessages(MSG_UPDATE_NOTIFICATIONS)) {
                mHandler.sendEmptyMessage(MSG_UPDATE_NOTIFICATIONS);
            }
        }
    }

    private void updateNotificationIcons() {
        final LinearLayout.LayoutParams params
@@ -3869,7 +3874,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        if (MULTIUSER_DEBUG) mNotificationPanelDebugText.setText("USER " + newUserId);
        animateCollapsePanels();
        updatePublicMode(); 
        updateNotifications();
        updateNotifications(true);
        resetUserSetupObserver();
        setControllerUsers();

@@ -4642,7 +4647,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        updateDozingState();
        updatePublicMode();
        updateStackScrollerState(goingToFullShade);
        updateNotifications();
        updateNotifications(true);
        checkBarModes();
        updateCarrierLabelVisibility(false);
        updateMediaMetaData(false);
+1 −1
Original line number Diff line number Diff line
@@ -118,7 +118,7 @@ public class TvStatusBar extends BaseStatusBar {
    }

    @Override
    protected void updateNotifications() {
    protected void updateNotifications(boolean immediate) {
    }

    @Override