summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2022-02-23 10:32:21 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2022-02-23 10:32:21 +0000
commitdbb797600855c6e54fdb0f42b782a57d00fe9ee6 (patch)
treeabf590d63f75243b634cd65d5c94d62f50eef28d
parent5fe0e808429d3426a4324066052591b6bf8ba2b4 (diff)
parent1ae56219578efb02eaf4a021e06f473316c5a8bc (diff)
Merge "Ensure controller is attached before applying state"
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowController.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowController.java b/packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowController.java
index 6f587fde4436..c53d5107afcc 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowController.java
@@ -68,6 +68,7 @@ public class StatusBarWindowController {
private final StatusBarContentInsetsProvider mContentInsetsProvider;
private int mBarHeight = -1;
private final State mCurrentState = new State();
+ private boolean mIsAttached;
private final ViewGroup mStatusBarWindowView;
// The container in which we should run launch animations started from the status bar and
@@ -136,6 +137,8 @@ public class StatusBarWindowController {
mContentInsetsProvider.addCallback(this::calculateStatusBarLocationsForAllRotations);
calculateStatusBarLocationsForAllRotations();
+ mIsAttached = true;
+ apply(mCurrentState);
}
/** Adds the given view to the status bar window view. */
@@ -282,6 +285,9 @@ public class StatusBarWindowController {
}
private void apply(State state) {
+ if (!mIsAttached) {
+ return;
+ }
applyForceStatusBarVisibleFlag(state);
applyHeight(state);
if (mLp != null && mLp.copyFrom(mLpChanged) != 0) {