diff options
| -rw-r--r-- | services/core/java/com/android/server/inputmethod/InputMethodManagerService.java | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java index 68001428e567..c653dec1a299 100644 --- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java @@ -2723,17 +2723,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. return false; } - final InputMethodSettings settings = InputMethodSettingsRepository.get(userId); - if (Flags.imeSwitcherRevamp()) { - // The IME switcher button should be shown when the current IME specified a - // language settings activity. - final var curImi = settings.getMethodMap().get(settings.getSelectedInputMethod()); - if (curImi != null && curImi.createImeLanguageSettingsActivityIntent() != null) { - return true; - } - } - - return hasMultipleSubtypesForSwitcher(false /* nonAuxOnly */, settings); + return hasMultipleSubtypesForSwitcher(false /* nonAuxOnly */, userId); } /** @@ -2741,10 +2731,11 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. * across all enabled IMEs for the given user. * * @param nonAuxOnly whether to check only for non auxiliary subtypes. - * @param settings the input method settings under the given user ID. + * @param userId the id of the user for which to check the number of subtypes. */ private static boolean hasMultipleSubtypesForSwitcher(boolean nonAuxOnly, - @NonNull InputMethodSettings settings) { + @UserIdInt int userId) { + final var settings = InputMethodSettingsRepository.get(userId); List<InputMethodInfo> imes = settings.getEnabledInputMethodListWithFilter( InputMethodInfo::shouldShowInInputMethodPicker); final int numImes = imes.size(); @@ -4130,8 +4121,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. @GuardedBy("ImfLock.class") private void onImeSwitchButtonClickLocked(int displayId, @NonNull UserData userData) { final int userId = userData.mUserId; - final var settings = InputMethodSettingsRepository.get(userId); - if (hasMultipleSubtypesForSwitcher(true /* nonAuxOnly */, settings)) { + if (hasMultipleSubtypesForSwitcher(true /* nonAuxOnly */, userId)) { switchToNextInputMethodLocked(false /* onlyCurrentIme */, userData); } else { showInputMethodPickerFromSystem( |