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

Commit a7b9b69e authored by Ming-Shin Lu's avatar Ming-Shin Lu Committed by Android (Google) Code Review
Browse files

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

parents 25be63a7 08a970ca
Loading
Loading
Loading
Loading
+13 −1
Original line number Original line Diff line number Diff line
@@ -419,8 +419,12 @@ final class InputMonitor {
                if (mInputFocus != recentsAnimationInputConsumer.mWindowHandle.token) {
                if (mInputFocus != recentsAnimationInputConsumer.mWindowHandle.token) {
                    requestFocus(recentsAnimationInputConsumer.mWindowHandle.token,
                    requestFocus(recentsAnimationInputConsumer.mWindowHandle.token,
                            recentsAnimationInputConsumer.mName);
                            recentsAnimationInputConsumer.mName);
                }
                if (mDisplayContent.mInputMethodWindow != null
                        && mDisplayContent.mInputMethodWindow.isVisible()) {
                    // Hiding IME/IME icon when recents input consumer gain focus.
                    // 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
                        // 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.
                        // snapshot Task with IME window to animate together in this case.
                        final InputMethodManagerInternal inputMethodManagerInternal =
                        final InputMethodManagerInternal inputMethodManagerInternal =
@@ -429,6 +433,14 @@ final class InputMonitor {
                            inputMethodManagerInternal.hideCurrentInputMethod(
                            inputMethodManagerInternal.hideCurrentInputMethod(
                                    SoftInputShowHideReason.HIDE_RECENTS_ANIMATION);
                                    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 {
                    } else {
                        // Disable IME icon explicitly when IME attached to the app in case
                        // Disable IME icon explicitly when IME attached to the app in case
                        // IME icon might flickering while swiping to the next app task still
                        // IME icon might flickering while swiping to the next app task still