summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java42
1 files changed, 30 insertions, 12 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
index f56e219b073a..b96a33d37dec 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
@@ -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);