summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Yohei Yukawa <yukawa@google.com> 2018-11-20 17:24:20 -0800
committer Yohei Yukawa <yukawa@google.com> 2018-11-20 17:24:20 -0800
commitcf3bbffa899437f028a0da5092f20a93b9a3b96a (patch)
tree3ff9f16d780b88f8b667b6a1c790522cba9e1432
parentd0f47278c4dae7274d6437942f2fca23c148f803 (diff)
Simplify IMMS#showInputMethodMenu() a bit
SwitchingController#getSortedInputMethodAndSubtypeListLocked() is anyway called to determine what items should be shown on the IME switcher dialog, whether there is no item to show or not should also be determined by the same method. There is no need to call getExplicitlyOrImplicitlyEnabledInputMethodsAndSubtypeListLocked() just to check whether its result is empty or not. Bug: 119837138 Test: Locally verified as follows: 1. Build and flash aosp_taimen-userdebug into taimen. 2. adb shell "settings put secure enabled_input_methods 'com.android.inputmethod.latin/.LatinIME;-921088104;-1337596075'" 3. Open the Dialer app and tap the top edit field. 4. Long tap the space key on AOSP Keyboard. 5. Make sure that IME switcher dialog is shown. 6. make -j SoftKeyboard 7. adb install -r $OUT/system/app/SoftKeyboard/SoftKeyboard.apk 8. adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard 9. Tap the keyboard icon on the navigation bar. 10. Make sure that IME switcher dialog is shown. Change-Id: Ie166bbd86179db1dae9e31f25d45e76c5e1b15ad
-rw-r--r--services/core/java/com/android/server/inputmethod/InputMethodManagerService.java12
1 files changed, 4 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 9d5d65d87062..b44207205d31 100644
--- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
@@ -3824,19 +3824,15 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
if (DEBUG) Slog.v(TAG, "Current IME: " + lastInputMethodId);
synchronized (mMethodMap) {
- final HashMap<InputMethodInfo, List<InputMethodSubtype>> immis =
- mSettings.getExplicitlyOrImplicitlyEnabledInputMethodsAndSubtypeListLocked(
- mContext);
- if (immis == null || immis.size() == 0) {
+ final List<ImeSubtypeListItem> imList =
+ mSwitchingController.getSortedInputMethodAndSubtypeListLocked(
+ showAuxSubtypes, isScreenLocked);
+ if (imList.isEmpty()) {
return;
}
hideInputMethodMenuLocked();
- final List<ImeSubtypeListItem> imList =
- mSwitchingController.getSortedInputMethodAndSubtypeListLocked(
- showAuxSubtypes, isScreenLocked);
-
if (lastInputMethodSubtypeId == NOT_A_SUBTYPE_ID) {
final InputMethodSubtype currentSubtype = getCurrentInputMethodSubtypeLocked();
if (currentSubtype != null) {