From 73c06b92183bcf94a9ad7216d8ce372ad2242f48 Mon Sep 17 00:00:00 2001 From: Jerry Chang Date: Fri, 12 Mar 2021 00:09:54 +0800 Subject: [PATCH] Prevent caching unexpected IME shown state for legacy split Due to DisplayImeController listens to insetsChanged and display rotation at all time, it might caching unexpected IME shown state in DividerImeController. Since RemoteInsetsControllerTarget only controlling insets during split mode, it won't receive hideInsets event when the target app request to hide IME. Thus leaving unexpected IME state in split component. When the next time entering split screen, it'll adjust split layout with wrong IME state. Update to not caching IME shown state in DividerImeController if the split is not activated. Bug: 176846448 Test: atest WMShellUnitTests Test: open IME and rotate and dock two apps in split mode, observed the divider bar is interactable and there's no dim layer on the secondary split Merged-In: I2f63eebb208b8c987a0a05615ddef4f6feef10d6 Change-Id: I2f63eebb208b8c987a0a05615ddef4f6feef10d6 --- .../systemui/stackdivider/DividerImeController.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerImeController.java b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerImeController.java index 5aeca5e07bdde..6c9f61be29860 100644 --- a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerImeController.java +++ b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerImeController.java @@ -141,14 +141,14 @@ class DividerImeController implements DisplayImeController.ImePositionProcessor @ImeAnimationFlags public int onImeStartPositioning(int displayId, int hiddenTop, int shownTop, boolean imeShouldShow, boolean imeIsFloating, SurfaceControl.Transaction t) { - mHiddenTop = hiddenTop; - mShownTop = shownTop; - mTargetShown = imeShouldShow; if (!isDividerVisible()) { return 0; } - final boolean splitIsVisible = !getView().isHidden(); + mHiddenTop = hiddenTop; + mShownTop = shownTop; + mTargetShown = imeShouldShow; mSecondaryHasFocus = getSecondaryHasFocus(displayId); + final boolean splitIsVisible = !getView().isHidden(); final boolean targetAdjusted = splitIsVisible && imeShouldShow && mSecondaryHasFocus && !imeIsFloating && !getLayout().mDisplayLayout.isLandscape() && !mSplits.mDivider.isMinimized();