Merge "Fix an edge case of IME surface overlapped on the overview" into udc-dev am: a7b9b69e53

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22160483

Change-Id: Icf552e938e7339be2c4200edda2af207811363e7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Ming-Shin Lu
2023-03-23 15:12:34 +00:00
committed by Automerger Merge Worker

View File

@@ -419,8 +419,12 @@ final class InputMonitor {
if (mInputFocus != recentsAnimationInputConsumer.mWindowHandle.token) {
requestFocus(recentsAnimationInputConsumer.mWindowHandle.token,
recentsAnimationInputConsumer.mName);
}
if (mDisplayContent.mInputMethodWindow != null
&& mDisplayContent.mInputMethodWindow.isVisible()) {
// Hiding IME/IME icon when recents input consumer gain focus.
if (!mDisplayContent.isImeAttachedToApp()) {
final boolean isImeAttachedToApp = mDisplayContent.isImeAttachedToApp();
if (!isImeAttachedToApp) {
// Hiding IME if IME window is not attached to app since it's not proper to
// snapshot Task with IME window to animate together in this case.
final InputMethodManagerInternal inputMethodManagerInternal =
@@ -429,6 +433,14 @@ final class InputMonitor {
inputMethodManagerInternal.hideCurrentInputMethod(
SoftInputShowHideReason.HIDE_RECENTS_ANIMATION);
}
// Ensure removing the IME snapshot when the app no longer to show on the
// task snapshot (also taking the new task snaphot to update the overview).
final ActivityRecord app = mDisplayContent.getImeInputTarget() != null
? mDisplayContent.getImeInputTarget().getActivityRecord() : null;
if (app != null) {
mDisplayContent.removeImeSurfaceImmediately();
mDisplayContent.mAtmService.takeTaskSnapshot(app.getTask().mTaskId);
}
} else {
// Disable IME icon explicitly when IME attached to the app in case
// IME icon might flickering while swiping to the next app task still