Only use the IME target from IMMS to update the IME control target

DisplayContent.mInputMethodTarget is only used for deciding which window
IME should attach to.

Fix: 152698568
Fix: 153287963
Test: Steps in the bugs.
Change-Id: Ife6b700436ffa6ce80af9c6c276c0fcf3a4e057a
This commit is contained in:
Tiger Huang
2020-04-07 18:27:38 +08:00
parent 9cea19d887
commit 304db43153

View File

@@ -197,7 +197,6 @@ import android.view.ViewRootImpl;
import android.view.WindowInsets;
import android.view.WindowManager;
import android.view.WindowManagerPolicyConstants.PointerEventListener;
import android.window.ITaskOrganizer;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.logging.MetricsLogger;
@@ -3426,7 +3425,10 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
private void setInputMethodTarget(WindowState target, boolean targetWaitingAnim) {
// Always update control target. This is needed to handle rotation.
updateImeControlTarget(target);
// We cannot set target as the control target, because mInputMethodTarget can only help
// decide the z-order of IME, but cannot control IME. Only the IME target reported from
// updateInputMethodTargetWindow can control IME.
updateImeControlTarget(mInputMethodControlTarget);
if (target == mInputMethodTarget && mInputMethodTargetWaitingAnim == targetWaitingAnim) {
return;
}