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

Commit 0b178b3c authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Simplify IMMS#setInputMethodLocked() a bit

This CL simplifies

  InputMethodManagerService#setInputMethodLocked()

a bit by explicitly having a local instance "userId" instead of using

  settings.getUserId()

as a synonym of it.

This is a mechanical refactoring CL, which should have no behavior
change.

Bug: 305849394
Test: presubmit
Flag: EXEMPT refactor
Change-Id: Iba73348d92ce818ecc93a88ca63baf13834a3251
parent f6239727
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -3079,7 +3079,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.

    @GuardedBy("ImfLock.class")
    void setInputMethodLocked(String id, int subtypeId, int deviceId) {
        final InputMethodSettings settings = InputMethodSettingsRepository.get(mCurrentUserId);
        final int userId = mCurrentUserId;
        final InputMethodSettings settings = InputMethodSettingsRepository.get(userId);
        InputMethodInfo info = settings.getMethodMap().get(id);
        if (info == null) {
            throw getExceptionForUnknownImeId(id);
@@ -3087,7 +3088,6 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.

        // See if we need to notify a subtype change within the same IME.
        if (id.equals(getSelectedMethodIdLocked())) {
            final int userId = settings.getUserId();
            final int subtypeCount = info.getSubtypeCount();
            if (subtypeCount <= 0) {
                notifyInputMethodSubtypeChangedLocked(userId, info, null);
@@ -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(mCurrentUserId).setSelectedMethodId(id);
            getInputMethodBindingController(userId).setSelectedMethodId(id);

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