From 0ffa46bdc6323e101de61076c2c32c89b785829e Mon Sep 17 00:00:00 2001 From: Ming-Shin Lu Date: Sat, 26 Feb 2022 00:13:09 +0800 Subject: [PATCH] Remove isAnimating check in assignRelativeLayerForIme Originally checking animating logic added in assignRelativeLayerForIme from CL[1] is to fix IME flickering when playing app exit transition while closing IME animation is not synchronized. The original fix is not set RelZ to promote IME layer on top of the IME target during animating in case seen IME animating while closing the app. Now with better IME transition, IME surface parent can be reparented/attached to the activity surface, also with IME screenshot mechanism we can guarantee that IME screenshot will still remain on top of the activity while pressing home key to close the app. Beside, adding isAnimating logic somehow raised the risk that may not set relZ correctly if the app transition duration took longer like the issue case is IME behind the dialog without setting relZ because the longer default activity transition duration in T (400ms -> 450ms) As the above reason, simply removing the isAnimating check to fix this IME layering issue. [1]: I0fb66b4cab8aa474c7a64d0cefd32310151d544e Fix: 220960733 Test: atest ZOrderingTests Test: atest FlickerTest#CloseImeWindowToHomeTest Test: manual as test steps: 0) Open Setup Wizard activity 1) Defering the setup with touching on 4 corners of the screen 2) Go to Settings -> Display -> turn on/off Dark theme 3) Scroll down the notification then click Pixel Setup 4) Select the wifi network, expect IME is shown on top of the wifi dialog Change-Id: I93abda73c80e159dece6c6908414d39ae56b5a6e --- .../core/java/com/android/server/wm/DisplayContent.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index 77787e1e7530f..99f4e5e812e26 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -128,7 +128,6 @@ import static com.android.server.wm.DisplayContentProto.RESUMED_ACTIVITY; import static com.android.server.wm.DisplayContentProto.ROOT_DISPLAY_AREA; import static com.android.server.wm.DisplayContentProto.SCREEN_ROTATION_ANIMATION; import static com.android.server.wm.DisplayContentProto.SLEEP_TOKENS; -import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_ALL; import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_APP_TRANSITION; import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_RECENTS; import static com.android.server.wm.WindowContainer.AnimationFlags.PARENTS; @@ -5003,10 +5002,6 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp // docked divider while keeping the app itself below the docked divider, so instead // we will put the docked divider below the IME. @see #assignRelativeLayerForImeTargetChild // - // In the case the IME target is animating, the animation Z order may be different - // than the WindowContainer Z order, so it's difficult to be sure we have the correct - // IME target. In this case we just layer the IME over its parent surface. - // // In the case where we have no IME target we let its window parent to place it. // // Keep IME window in surface parent as long as app's starting window @@ -5022,9 +5017,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp // We don't need to set relative layer if the IME target in non-multi-window // mode is the activity main window since updateImeParent will ensure the IME // surface be attached on the fullscreen activity. - && imeTarget.mAttrs.type != TYPE_BASE_APPLICATION - && imeTarget.mToken.getActivity(app -> app.isAnimating(TRANSITION | PARENTS, - ANIMATION_TYPE_ALL & ~ANIMATION_TYPE_RECENTS)) == null; + && imeTarget.mAttrs.type != TYPE_BASE_APPLICATION; if (canImeTargetSetRelativeLayer) { mImeWindowsContainer.assignRelativeLayer(t, imeTarget.getSurfaceControl(), // TODO: We need to use an extra level on the app surface to ensure