diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index 8eb0046ff9237..6c1b5bcdccfd6 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -3979,6 +3979,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp } ProtoLog.i(WM_DEBUG_IME, "setInputMethodTarget %s", target); + final boolean layeringTargetChanged = target != mImeLayeringTarget; mImeLayeringTarget = target; // 1. Reparent the IME container window to the target root DA to get the correct bounds and @@ -4006,7 +4007,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp // 4. Update the IME control target to apply any inset change and animation. // 5. Reparent the IME container surface to either the input target app, or the IME window // parent. - updateImeControlTarget(true /* forceUpdateImeParent */); + updateImeControlTarget(layeringTargetChanged); } @VisibleForTesting