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

Commit 5c978ad7 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix StatusBar setting disable flags before setting up"

parents 0d51e3fc b5d95d97
Loading
Loading
Loading
Loading
+30 −12
Original line number Diff line number Diff line
@@ -651,7 +651,9 @@ public class StatusBar extends SystemUI implements DemoMode,
                wallpaperChangedFilter, null /* broadcastPermission */, null /* scheduler */);
        mWallpaperChangedReceiver.onReceive(mContext, null);

        mCommandQueue.disable(switches[0], switches[6], false /* animate */);
        // Set up the initial notification state. This needs to happen before CommandQueue.disable()
        setUpPresenter();

        setSystemUiVisibility(switches[1], switches[7], switches[8], 0xffffffff,
                fullscreenStackBounds, dockedStackBounds);
        topAppWindowChanged(switches[2] != 0);
@@ -664,17 +666,6 @@ public class StatusBar extends SystemUI implements DemoMode,
            mCommandQueue.setIcon(iconSlots.get(i), icons.get(i));
        }

        // Set up the initial notification state.
        mPresenter = new StatusBarNotificationPresenter(mContext, mNotificationPanel,
                mHeadsUpManager, mStatusBarWindow, mStackScroller, mDozeScrimController,
                mScrimController, this);
        mAppOpsListener.setUpWithPresenter(mPresenter);
        mNotificationListener.setUpWithPresenter(mPresenter);
        mNotificationShelf.setOnActivatedListener(mPresenter);
        mRemoteInputManager.getController().addCallback(mStatusBarWindowController);

        // set the initial view visibility
        Dependency.get(InitController.class).addPostInitTask(this::updateAreThereNotifications);

        if (DEBUG) {
            Log.d(TAG, String.format(
@@ -720,6 +711,13 @@ public class StatusBar extends SystemUI implements DemoMode,
        Dependency.get(ActivityStarterDelegate.class).setActivityStarterImpl(this);

        Dependency.get(ConfigurationController.class).addCallback(this);

        // set the initial view visibility
        Dependency.get(InitController.class).addPostInitTask(this::updateAreThereNotifications);
        Dependency.get(InitController.class).addPostInitTask(() -> {
            setUpDisableFlags(switches[0], switches[6]);
        });

    }

    // ================================================================================
@@ -981,6 +979,26 @@ public class StatusBar extends SystemUI implements DemoMode,
        ThreadedRenderer.overrideProperty("ambientRatio", String.valueOf(1.5f));
    }

    protected void setUpPresenter() {
        // Set up the initial notification state.
        mPresenter = new StatusBarNotificationPresenter(mContext, mNotificationPanel,
                mHeadsUpManager, mStatusBarWindow, mStackScroller, mDozeScrimController,
                mScrimController, this);
        mAppOpsListener.setUpWithPresenter(mPresenter);
        mNotificationListener.setUpWithPresenter(mPresenter);
        mNotificationShelf.setOnActivatedListener(mPresenter);
        mRemoteInputManager.getController().addCallback(mStatusBarWindowController);
    }

    /**
     * Post-init task of {@link #start()}
     * @param state1 disable1 flags
     * @param state2 disable2 flags
     */
    protected void setUpDisableFlags(int state1, int state2) {
        mCommandQueue.disable(state1, state2, false /* animate */);
    }

    @Override
    public void addAfterKeyguardGoneRunnable(Runnable runnable) {
        mStatusBarKeyguardViewManager.addAfterKeyguardGoneRunnable(runnable);