From 7aec231acaa484eef170b96bcd58de2cd55ec8be Mon Sep 17 00:00:00 2001 From: chaviw Date: Wed, 27 May 2020 15:57:07 -0700 Subject: [PATCH] Ignore insets provider visibility when checking performLayout When the client calls relayout, it will not check the insets provider visibility. Because of that, we also shouldn't check that value when calling isGoneForLayoutLw. Otherwise, we could end up requesting to relayout, but never be able to execute the performLayout. Test: 1. Open app and rotate to landscape 2. Lock screen 3. Rotate to portrait and unlock 4. NavigationBar has mEnterAnimationPending set to false Fixes: 152537982 Change-Id: I3ce4672636d27a9940aef93a5a73a69c4896fa20 --- services/core/java/com/android/server/wm/WindowState.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index e9aff88d0f80d..234900e36245c 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -1784,7 +1784,11 @@ class WindowState extends WindowContainer implements WindowManagerP final ActivityRecord atoken = mActivityRecord; return mViewVisibility == View.GONE || !mRelayoutCalled - || (atoken == null && !mToken.isVisible()) + // We can't check isVisible here because it will also check the client visibility + // for WindowTokens. Even if the client is not visible, we still need to perform + // a layout since they can request relayout when client visibility is false. + // TODO (b/157682066) investigate if we can clean up isVisible + || (atoken == null && !(wouldBeVisibleIfPolicyIgnored() && isVisibleByPolicy())) || (atoken != null && !atoken.mVisibleRequested) || isParentWindowGoneForLayout() || (mAnimatingExit && !isAnimatingLw())