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

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

Merge "Fix Stay on 'SELECT INPUT METHOD' page after choosing input method"...

Merge "Fix Stay on 'SELECT INPUT METHOD' page after choosing input method" into sc-dev am: 0077be7b

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

Change-Id: Ic3943ad51ce391f42896752a30d85fb142e61c9d
parents 7b13bb8e 0077be7b
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -754,16 +754,16 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
        // dismissing during the task switching to keep the window focus because IME window has
        // higher window hierarchy, we don't give it focus if the next IME layering target
        // doesn't request IME visible.
        if (w.mIsImWindow && (mImeLayeringTarget == null
        if (w.mIsImWindow && w.isChildWindow() && (mImeLayeringTarget == null
                || !mImeLayeringTarget.getRequestedVisibility(ITYPE_IME))) {
            if (w.mAttrs.type == TYPE_INPUT_METHOD_DIALOG) {
            return false;
        }

            if (w.isChildWindow()) {
        if (w.mAttrs.type == TYPE_INPUT_METHOD_DIALOG && mImeLayeringTarget != null
                && !mImeLayeringTarget.getRequestedVisibility(ITYPE_IME)
                && mImeLayeringTarget.isAnimating(PARENTS | TRANSITION,
                ANIMATION_TYPE_APP_TRANSITION)) {
            return false;
        }
        }

        final ActivityRecord activity = w.mActivityRecord;

+3 −0
Original line number Diff line number Diff line
@@ -2219,6 +2219,9 @@ public class DisplayContentTests extends WindowTestsBase {
        // request IME visible.
        final WindowState nextImeAppTarget =
                createWindow(null, TYPE_BASE_APPLICATION, mDisplayContent, "nextImeAppTarget");
        spyOn(nextImeAppTarget);
        doReturn(true).when(nextImeAppTarget).isAnimating(PARENTS | TRANSITION,
                ANIMATION_TYPE_APP_TRANSITION);
        mDisplayContent.setImeLayeringTarget(nextImeAppTarget);
        assertNotEquals(imeMenuDialog, mDisplayContent.findFocusedWindow());
    }