diff options
| author | 2024-06-11 16:38:07 -0700 | |
|---|---|---|
| committer | 2024-06-12 01:03:08 +0000 | |
| commit | 523fefbecb750d263ea47f588154ad5fed5096a1 (patch) | |
| tree | 2a3486e61d8d4c990e8a1686632039c00d8d86f7 | |
| parent | 2da64f9b69fc92d0d33049f348b46a8c8c0aa8ff (diff) | |
Simplify IMMS#postInputMethodSettingUpdatedLocked() a bit
This CL simplifies
InputMethodManagerService#postInputMethodSettingUpdatedLocked()
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: Idb8acd978fb6da285349841da61de018a0a7e19b
| -rw-r--r-- | services/core/java/com/android/server/inputmethod/InputMethodManagerService.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java index 46e5a8fc7fb6..942888f2771d 100644 --- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java @@ -5248,7 +5248,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. } mMethodMapUpdateCount++; - final InputMethodSettings settings = InputMethodSettingsRepository.get(mCurrentUserId); + final int userId = mCurrentUserId; + final InputMethodSettings settings = InputMethodSettingsRepository.get(userId); boolean reenableMinimumNonAuxSystemImes = false; // TODO: The following code should find better place to live. @@ -5311,18 +5312,18 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. updateDefaultVoiceImeIfNeededLocked(); // TODO: Instantiate mSwitchingController for each user. - if (settings.getUserId() == mSwitchingController.getUserId()) { + if (userId == mSwitchingController.getUserId()) { mSwitchingController.resetCircularListLocked(settings.getMethodMap()); } else { mSwitchingController = InputMethodSubtypeSwitchingController.createInstanceLocked( mContext, settings.getMethodMap(), mCurrentUserId); } // TODO: Instantiate mHardwareKeyboardShortcutController for each user. - if (settings.getUserId() == mHardwareKeyboardShortcutController.getUserId()) { + if (userId == mHardwareKeyboardShortcutController.getUserId()) { mHardwareKeyboardShortcutController.reset(settings.getMethodMap()); } else { mHardwareKeyboardShortcutController = new HardwareKeyboardShortcutController( - settings.getMethodMap(), settings.getUserId()); + settings.getMethodMap(), userId); } sendOnNavButtonFlagsChangedLocked(); @@ -5330,7 +5331,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. // Notify InputMethodListListeners of the new installed InputMethods. final List<InputMethodInfo> inputMethodList = settings.getMethodList(); mHandler.obtainMessage(MSG_DISPATCH_ON_INPUT_METHOD_LIST_UPDATED, - settings.getUserId(), 0 /* unused */, inputMethodList).sendToTarget(); + userId, 0 /* unused */, inputMethodList).sendToTarget(); } @GuardedBy("ImfLock.class") |