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

Commit 2487cabc authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Rename #updateInputMethodWindowStatus() to #setDismissImeOnBackKeyPressed()

This is a purely mechanical method renaming.  There should be no
behavior chagne.

To summarize,

  WindowManagerInternal#updateInputMethodWindowStatus()

should be renamed to

  WindowManagerInternal#setDismissImeOnBackKeyPressed()

and this CL actually does so with also removing unused parameters.

The method in question was originally added by me for the
true-IME-target-window project [1] at Bug 34628091 then updated to
propagate one more boolean value from InputMethodManagerService to
PhoneWindowManager to address a feature request from Wear team [2] at
Bug 33824860.

After that, we also introduced another method

   WindowManagerInternal#updateInputMethodTargetWindow()

for the true-IME-target-window project [3] and that's what we ended up
having relied on.  Given that #updateInputMethodWindowStatus() is used
only for Bug 33824860 to propagate "dismissImeOnBackKeyPressed"
parameter from IMMS to PhoneWindowManager, it'd make more sense to
rename its method name as well.

 [1]: I54fb1faf513883a54293a756e4c9d2ae9453d778
      69e68024
 [2]: I20721547c73360a70b5fc5cbe06824d577d1768a
      d6475a68
 [3]: I032b91ce722a16b17518a5d88015c574d7d3e51b
      99e1f6e0

Bug: 171827834
Test: presubmit
Change-Id: I3b32d43615453d94d5df1565fe1ce81dc08526de
parent b4dfa621
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -2923,8 +2923,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
                dismissImeOnBackKeyPressed = ((vis & InputMethodService.IME_VISIBLE) != 0);
                break;
        }
        mWindowManagerInternal.updateInputMethodWindowStatus(token,
                (vis & InputMethodService.IME_VISIBLE) != 0, dismissImeOnBackKeyPressed);
        mWindowManagerInternal.setDismissImeOnBackKeyPressed(dismissImeOnBackKeyPressed);
    }

    @BinderThread
+2 −11
Original line number Diff line number Diff line
@@ -451,24 +451,15 @@ public abstract class WindowManagerInternal {
    public abstract int getInputMethodWindowVisibleHeight(int displayId);

    /**
     * Notifies WindowManagerService that the current IME window status is being changed.
     * Notifies WindowManagerService that the expected back-button behavior might have changed.
     *
     * <p>Only {@link com.android.server.inputmethod.InputMethodManagerService} is the expected and
     * tested caller of this method.</p>
     *
     * @param imeToken token to track the active input method. Corresponding IME windows can be
     *                 identified by checking {@link android.view.WindowManager.LayoutParams#token}.
     *                 Note that there is no guarantee that the corresponding window is already
     *                 created
     * @param imeWindowVisible whether the active IME thinks that its window should be visible or
     *                         hidden, no matter how WindowManagerService will react / has reacted
     *                         to corresponding API calls.  Note that this state is not guaranteed
     *                         to be synchronized with state in WindowManagerService.
     * @param dismissImeOnBackKeyPressed {@code true} if the software keyboard is shown and the back
     *                                   key is expected to dismiss the software keyboard.
     */
    public abstract void updateInputMethodWindowStatus(@NonNull IBinder imeToken,
            boolean imeWindowVisible, boolean dismissImeOnBackKeyPressed);
    public abstract void setDismissImeOnBackKeyPressed(boolean dismissImeOnBackKeyPressed);

    /**
     * Notifies WindowManagerService that the current IME window status is being changed.
+1 −2
Original line number Diff line number Diff line
@@ -7713,8 +7713,7 @@ public class WindowManagerService extends IWindowManager.Stub
        }

        @Override
        public void updateInputMethodWindowStatus(@NonNull IBinder imeToken,
                boolean imeWindowVisible, boolean dismissImeOnBackKeyPressed) {
        public void setDismissImeOnBackKeyPressed(boolean dismissImeOnBackKeyPressed) {
            mPolicy.setDismissImeOnBackKeyPressed(dismissImeOnBackKeyPressed);
        }