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

Commit ede9fb07 authored by Taran Singh's avatar Taran Singh Committed by Android (Google) Code Review
Browse files

Merge "Reset IME show request when hide is requested"

parents 90a6a456 bd24ee76
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -56,8 +56,6 @@ class ImeInsetsSourceProvider extends InsetsSourceProvider {
        if (mIsImeLayoutDrawn && mShowImeRunner != null) {
            // Show IME if InputMethodService requested to be shown and it's layout has finished.
            mShowImeRunner.run();
            mIsImeLayoutDrawn = false;
            mShowImeRunner = null;
        }
    }

@@ -74,10 +72,19 @@ class ImeInsetsSourceProvider extends InsetsSourceProvider {
                mDisplayContent.mInputMethodTarget.showInsets(
                        WindowInsets.Type.ime(), true /* fromIme */);
            }
            mImeTargetFromIme = null;
            abortShowImePostLayout();
        };
    }

    /**
     * Abort any pending request to show IME post layout.
     */
    void abortShowImePostLayout() {
        mImeTargetFromIme = null;
        mIsImeLayoutDrawn = false;
        mShowImeRunner = null;
    }

    private boolean isImeTargetFromDisplayContentAndImeSame() {
        // IMMS#mLastImeTargetWindow always considers focused window as
        // IME target, however DisplayContent#computeImeTarget() can compute
+3 −0
Original line number Diff line number Diff line
@@ -7331,6 +7331,9 @@ public class WindowManagerService extends IWindowManager.Stub
            synchronized (mGlobalLock) {
                final DisplayContent dc = mRoot.getDisplayContent(displayId);
                if (dc != null && dc.mInputMethodTarget != null) {
                    // If there was a pending IME show(), reset it as IME has been
                    // requested to be hidden.
                    dc.getInsetsStateController().getImeSourceProvider().abortShowImePostLayout();
                    dc.mInputMethodTarget.hideInsets(WindowInsets.Type.ime(), true /* fromIme */);
                }
            }