DisplayContent: Don't force-update parent if layering didn't change
A recent change to provide IME support for SurfaceControlViewHost modified logic for setImeLayeringTargetInner. setImeLayeringTarget inner also updates the control target, which may depend on the input target. In the case of SurfaceControlViewHost the input target can change with the layering target not changing, and so we need to update the control target, which was done by extending the conditions on the return at the beginning of setImeLayeringTargetInner to also include the check for mLastImeInputTarget == mImeInputTarget. However in standard app cases, this can produce a scenario where we consider the IME parent as changed, even when it wasn't (when neither the layering or the control target update). This CL partially restores the previous logic by not forcing the IME parent update when the layering target didn't really change. Bug: 226338567 Test: Existing tests pass Change-Id: I8ec9583feca8a0be9c90b0a4a2a382bf915ae4be
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user