From 8734d474e6ea6c707f9d54d271735f78cfb25f4c Mon Sep 17 00:00:00 2001 From: Tiger Huang Date: Thu, 5 Mar 2020 16:29:40 +0800 Subject: [PATCH] Correct the default value of mRequestedInsetsState The default value of WindowState.mRequestedInsetsState should be the same as the default value of InsetsController.mState. Previously, the default value was assigned as the current insets state of the system, which doesn't reflect the fact about the request. Bug: 150554206 Test: 1. Reboot the device to lockscreen. 2. Unlock. 3. Swipe up from the screen bottom. Change-Id: If35154358e30b886289e09a6556a444a80c3ce67 --- services/core/java/com/android/server/wm/WindowState.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index 805ef094e7109..2a204494fa67e 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -657,7 +657,7 @@ class WindowState extends WindowContainer implements WindowManagerP private boolean mIsDimming = false; private @Nullable InsetsSourceProvider mControllableInsetProvider; - private InsetsState mRequestedInsetsState; + private final InsetsState mRequestedInsetsState = new InsetsState(); private static final float DEFAULT_DIM_AMOUNT_DEAD_WINDOW = 0.5f; private KeyInterceptionInfo mKeyInterceptionInfo; @@ -816,9 +816,6 @@ class WindowState extends WindowContainer implements WindowManagerP mSeq = seq; mPowerManagerWrapper = powerManagerWrapper; mForceSeamlesslyRotate = token.mRoundedCornerOverlay; - mRequestedInsetsState = new InsetsState( - getDisplayContent().getInsetsPolicy().getInsetsForDispatch(this), - true /* copySources */); if (DEBUG) { Slog.v(TAG, "Window " + this + " client=" + c.asBinder() + " token=" + token + " (" + mAttrs.token + ")" + " params=" + a);