Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 73e30b71 authored by Ming-Shin Lu's avatar Ming-Shin Lu Committed by Automerger Merge Worker
Browse files

Merge "Fix an edge case of IME surface overlapped on the overview" into...

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

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



Change-Id: I30b21b071b60dc5055999d05a9cf3c016c743332
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 3ba8ccad e96441bb
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -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