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

Commit 233680ab authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Rename IMMI#hideAllInputMethods to #hideInputMethod

This CL renames

  InputMethodManagerInternal#hideAllInputMethods()

to

  InputMethodManagerInternal#hideInputMethod()

as it is now clear that just resolving the user ID from the display ID
is sufficient in the initial concurrent multi-user IME support.

This is just a renaming as a follow up to my previouls CL [1]. There
must be no behavior change.

 [1]: I464390927a9bea86769e11a6f97f1d4796991d77
      553a5a6d

Bug: 308479256
Test: presubmit
Flag: android.view.inputmethod.concurrent_input_methods
Change-Id: I7e314e3d31c6d3c3476522fba0dd88a1c9bd03dd
parent b8480739
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -75,13 +75,13 @@ public abstract class InputMethodManagerInternal {
    public abstract void setInteractive(boolean interactive);

    /**
     * Hides the input methods for all the users, if visible.
     * Hides the input method for the specified {@code originatingDisplayId}, if visible.
     *
     * @param reason               the reason for hiding the current input method
     * @param originatingDisplayId the display ID the request is originated
     */
    @ImfLockFree
    public abstract void hideAllInputMethods(@SoftInputShowHideReason int reason,
    public abstract void hideInputMethod(@SoftInputShowHideReason int reason,
            int originatingDisplayId);

    /**
@@ -315,7 +315,7 @@ public abstract class InputMethodManagerInternal {

                @ImfLockFree
                @Override
                public void hideAllInputMethods(@SoftInputShowHideReason int reason,
                public void hideInputMethod(@SoftInputShowHideReason int reason,
                        int originatingDisplayId) {
                }

+5 −5
Original line number Diff line number Diff line
@@ -254,7 +254,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
    private @interface MultiUserUnawareField {
    }

    private static final int MSG_HIDE_ALL_INPUT_METHODS = 1035;
    private static final int MSG_HIDE_INPUT_METHOD = 1035;
    private static final int MSG_REMOVE_IME_SURFACE = 1060;
    private static final int MSG_REMOVE_IME_SURFACE_FROM_WINDOW = 1061;

@@ -5066,7 +5066,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
    @Override
    public boolean handleMessage(Message msg) {
        switch (msg.what) {
            case MSG_HIDE_ALL_INPUT_METHODS: {
            case MSG_HIDE_INPUT_METHOD: {
                @SoftInputShowHideReason final int reason = msg.arg1;
                final int originatingDisplayId = msg.arg2;
                synchronized (ImfLock.class) {
@@ -5802,10 +5802,10 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.

        @ImfLockFree
        @Override
        public void hideAllInputMethods(@SoftInputShowHideReason int reason,
        public void hideInputMethod(@SoftInputShowHideReason int reason,
                int originatingDisplayId) {
            mHandler.removeMessages(MSG_HIDE_ALL_INPUT_METHODS);
            mHandler.obtainMessage(MSG_HIDE_ALL_INPUT_METHODS, reason, originatingDisplayId)
            mHandler.removeMessages(MSG_HIDE_INPUT_METHOD);
            mHandler.obtainMessage(MSG_HIDE_INPUT_METHOD, reason, originatingDisplayId)
                    .sendToTarget();
        }

+1 −2
Original line number Diff line number Diff line
@@ -1158,8 +1158,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                    break;
                case SHORT_PRESS_POWER_CLOSE_IME_OR_GO_HOME: {
                    if (mDismissImeOnBackKeyPressed) {
                        // TODO(b/308479256): Check if hiding "all" IMEs is OK or not.
                        InputMethodManagerInternal.get().hideAllInputMethods(
                        InputMethodManagerInternal.get().hideInputMethod(
                                SoftInputShowHideReason.HIDE_POWER_BUTTON_GO_HOME, displayId);
                    } else {
                        shortPressPowerGoHome();
+1 −2
Original line number Diff line number Diff line
@@ -1890,8 +1890,7 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
        enforceStatusBarService();
        final long token = Binder.clearCallingIdentity();
        try {
            // TODO(b/308479256): Check if hiding "all" IMEs is OK or not.
            InputMethodManagerInternal.get().hideAllInputMethods(
            InputMethodManagerInternal.get().hideInputMethod(
                    SoftInputShowHideReason.HIDE_BUBBLES, displayId);
        } finally {
            Binder.restoreCallingIdentity(token);
+1 −2
Original line number Diff line number Diff line
@@ -439,8 +439,7 @@ final class InputMonitor {
                        final InputMethodManagerInternal inputMethodManagerInternal =
                                LocalServices.getService(InputMethodManagerInternal.class);
                        if (inputMethodManagerInternal != null) {
                            // TODO(b/308479256): Check if hiding "all" IMEs is OK or not.
                            inputMethodManagerInternal.hideAllInputMethods(
                            inputMethodManagerInternal.hideInputMethod(
                                    SoftInputShowHideReason.HIDE_RECENTS_ANIMATION,
                                    mDisplayContent.getDisplayId());
                        }