OSDN Git Service

Keyguard: Reapply insets when fitsSystemWindow changes
authorAdrian Roos <roosa@google.com>
Wed, 27 Jul 2016 22:12:40 +0000 (15:12 -0700)
committerAdrian Roos <roosa@google.com>
Wed, 27 Jul 2016 22:12:43 +0000 (15:12 -0700)
Fixes a race in setting up the bouncer. Previously, if the bouncer was
set up before fitting system windows changed to keyguard mode, the bouncer
would not get the insets because they were eaten by the status bar view.

Change-Id: I326081604c59d0a7d57257f4c16bba54edd8d6c0
Fixes: 30401184

packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java

index 5271481..a7a792b 100644 (file)
@@ -168,7 +168,11 @@ public class StatusBarWindowManager implements RemoteInputController.Callback {
     }
 
     private void applyFitsSystemWindows(State state) {
-        mStatusBarView.setFitsSystemWindows(!state.isKeyguardShowingAndNotOccluded());
+        boolean fitsSystemWindows = !state.isKeyguardShowingAndNotOccluded();
+        if (mStatusBarView.getFitsSystemWindows() != fitsSystemWindows) {
+            mStatusBarView.setFitsSystemWindows(fitsSystemWindows);
+            mStatusBarView.requestApplyInsets();
+        }
     }
 
     private void applyUserActivityTimeout(State state) {