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

Commit 5248ca4f authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Simplify IMMS#setInputMethodLocked() a bit

As a preparation to make IMMS#mCurrentSubtype per-user, this CL
simplifies

  InputMethodManagerService#setInputMethodLocked()

without changing any behavior.

Bug: 346658341
Test: presubmit
Flag: EXEMPT refactor
Change-Id: I07f7ed9ec26ed18c982f62e2b9f2057f369acf84
parent 25baebe5
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -3084,8 +3084,9 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
            throw getExceptionForUnknownImeId(id);
        }

        final var bindingController = getInputMethodBindingController(userId);
        // See if we need to notify a subtype change within the same IME.
        if (id.equals(getSelectedMethodIdLocked())) {
        if (id.equals(bindingController.getSelectedMethodId())) {
            final int subtypeCount = info.getSubtypeCount();
            if (subtypeCount <= 0) {
                notifyInputMethodSubtypeChangedLocked(userId, info, null);
@@ -3120,7 +3121,6 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
            return;
        }

        final var bindingController = getInputMethodBindingController(userId);
        // Changing to a different IME.
        if (bindingController.getDeviceIdToShowIme() != DEVICE_ID_DEFAULT
                && deviceId == DEVICE_ID_DEFAULT) {
@@ -3143,7 +3143,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
            // mCurMethodId should be updated after setSelectedInputMethodAndSubtypeLocked()
            // because mCurMethodId is stored as a history in
            // setSelectedInputMethodAndSubtypeLocked().
            getInputMethodBindingController(userId).setSelectedMethodId(id);
            bindingController.setSelectedMethodId(id);

            if (mActivityManagerInternal.isSystemReady()) {
                Intent intent = new Intent(Intent.ACTION_INPUT_METHOD_CHANGED);