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

Commit 15c44549 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Allow setImeWindowStatus with null startInputToken"

parents d0a2d5ed ee2a7ed3
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -296,9 +296,12 @@ public abstract class WindowManagerInternal {
     *                         to corresponding API calls.  Note that this state is not guaranteed
     *                         to be synchronized with state in WindowManagerService.
     * @param targetWindowToken token to identify the target window that the IME is associated with.
     *                          {@code null} when application, system, or the IME itself decided to
     *                          change its window visibility before being associated with any target
     *                          window.
     */
    public abstract void updateInputMethodWindowStatus(IBinder imeToken, boolean imeWindowVisible,
            IBinder targetWindowToken);
    public abstract void updateInputMethodWindowStatus(@NonNull IBinder imeToken,
            boolean imeWindowVisible, @Nullable IBinder targetWindowToken);

    /**
      * Returns true when the hardware keyboard is available.
+3 −9
Original line number Diff line number Diff line
@@ -2033,10 +2033,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
    @Override
    public void setImeWindowStatus(IBinder token, IBinder startInputToken, int vis,
            int backDisposition) {
        if (startInputToken == null) {
            throw new InvalidParameterException("startInputToken cannot be null");
        }

        if (!calledWithValidToken(token)) {
            return;
        }
@@ -2044,15 +2040,13 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
        final StartInputInfo info;
        synchronized (mMethodMap) {
            info = mStartInputMap.get(startInputToken);
            if (info == null) {
                throw new InvalidParameterException("Unknown startInputToken=" + startInputToken);
            }
            mImeWindowVis = vis;
            mBackDisposition = backDisposition;
            updateSystemUiLocked(token, vis, backDisposition);
        }
        mWindowManagerInternal.updateInputMethodWindowStatus(info.mImeToken,
                (vis & InputMethodService.IME_VISIBLE) != 0, info.mTargetWindow);
        mWindowManagerInternal.updateInputMethodWindowStatus(token,
                (vis & InputMethodService.IME_VISIBLE) != 0,
                token != null ? info.mTargetWindow : null);
    }

    private void updateSystemUi(IBinder token, int vis, int backDisposition) {
+2 −2
Original line number Diff line number Diff line
@@ -7864,8 +7864,8 @@ public class WindowManagerService extends IWindowManager.Stub
        }

        @Override
        public void updateInputMethodWindowStatus(IBinder imeToken, boolean imeWindowVisible,
                IBinder targetWindowToken) {
        public void updateInputMethodWindowStatus(@NonNull IBinder imeToken,
                boolean imeWindowVisible, @Nullable IBinder targetWindowToken) {
            // TODO (b/34628091): Use this method to address the window animation issue.
            if (DEBUG_INPUT_METHOD) {
                Slog.w(TAG_WM, "updateInputMethodWindowStatus: imeToken=" + imeToken