diff options
| author | 2024-07-04 08:04:36 +0900 | |
|---|---|---|
| committer | 2024-07-04 08:04:36 +0900 | |
| commit | 5fc1daeb5b84c83ccd9a6736ef4afa16e2060a99 (patch) | |
| tree | 412495bd004aa5b854bda2999ac9147001445924 | |
| parent | 67de832dafcb8944a9bbf43baa2679c6824013c1 (diff) | |
Remove unintentinal early-returns in IMMS
This is a follow up CL to my previous CLs [1][2], which aimed to
implement a per-user initialization logic for concurrent multi-user
mode.
Apparently there are questionable early-returns in
#experimentalInitializeVisibleBackgroundUserLocked().
Let's make sure that the entire initialization logic is executed by
removing them.
There must be no behavior change in the existing single user mode, and
for concurrent multi-user mode, the new behavior should be the right
one.
[1]: I82cfc366b614d7e55a0f4fa11d5eaf5f0f8eb0a8
1ec914a0483a06e8fd845fe4e7b090ce3518d78c
[2]: I414a228e068fa53223234fe1db3e813474841604
f7d90f362d4cb2fce48d0b98fb58fca9197d3568
Bug: 341199701
Bug: 341558132
Test: presubmit
Flag: android.view.inputmethod.concurrent_input_methods
Change-Id: If659c309d57bf498aa5614734a6409ce478b7d8a
| -rw-r--r-- | services/core/java/com/android/server/inputmethod/InputMethodManagerService.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java index 1dfdc553641e..a2ba1674f33b 100644 --- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java @@ -2868,7 +2868,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. String enabledImeIdsStr = settings.getEnabledInputMethodsStr(); for (var imi : settings.getMethodList()) { if (!imi.isSystem()) { - return; + continue; } enabledImeIdsStr = InputMethodUtils.concatEnabledImeIds(enabledImeIdsStr, imi.getId()); } @@ -2881,19 +2881,18 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. if (TextUtils.isEmpty(id)) { final InputMethodInfo imi = InputMethodInfoUtils.getMostApplicableDefaultIME( settings.getEnabledInputMethodList()); - if (imi == null) { - return; + if (imi != null) { + id = imi.getId(); + settings.putSelectedInputMethod(id); } - id = imi.getId(); - settings.putSelectedInputMethod(id); } + final var bindingController = getInputMethodBindingController(userId); + bindingController.setSelectedMethodId(id); + // Also re-initialize controllers. final var userData = getUserData(userId); userData.mSwitchingController.resetCircularListLocked(mContext, settings); userData.mHardwareKeyboardShortcutController.update(settings); - - final var bindingController = getInputMethodBindingController(userId); - bindingController.setSelectedMethodId(id); } @GuardedBy("ImfLock.class") |