diff options
| author | satok <satok@google.com> | 2010-11-18 10:39:46 +0900 |
|---|---|---|
| committer | satok <satok@google.com> | 2010-11-18 10:47:12 +0900 |
| commit | 884ef9a11fb25b80630265daee46c5609707751f (patch) | |
| tree | 3e8aa29981c1aac601e6130c343b00ae10bc39e6 /services/java/com/android/server/InputMethodManagerService.java | |
| parent | 7b71b3d99f4b1cfbe70cc195ddc875a44f1dfb27 (diff) | |
Return the enabled subtypes for the current InputMethod when the input value of getEnabledInputMethodSubtypeList was null
Change-Id: I6892064dbc2214946871a0ba4ad08e00a2eb6c7b
Diffstat (limited to 'services/java/com/android/server/InputMethodManagerService.java')
| -rw-r--r-- | services/java/com/android/server/InputMethodManagerService.java | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java index 8d25d50a657c..84bc10079414 100644 --- a/services/java/com/android/server/InputMethodManagerService.java +++ b/services/java/com/android/server/InputMethodManagerService.java @@ -557,6 +557,9 @@ public class InputMethodManagerService extends IInputMethodManager.Stub public List<InputMethodSubtype> getEnabledInputMethodSubtypeList(InputMethodInfo imi) { synchronized (mMethodMap) { + if (imi == null && mCurMethodId != null) { + imi = mMethodMap.get(mCurMethodId); + } return mSettings.getEnabledInputMethodSubtypeListLocked(imi); } } @@ -2043,18 +2046,20 @@ public class InputMethodManagerService extends IInputMethodManager.Stub getEnabledInputMethodsAndSubtypeListLocked(); ArrayList<InputMethodSubtype> enabledSubtypes = new ArrayList<InputMethodSubtype>(); - for (Pair<String, ArrayList<String>> imsPair : imsList) { - InputMethodInfo info = mMethodMap.get(imsPair.first); - if (info != null && info.getId().equals(imi.getId())) { - ArrayList<InputMethodSubtype> subtypes = info.getSubtypes(); - for (InputMethodSubtype ims: subtypes) { - for (String s: imsPair.second) { - if (String.valueOf(ims.hashCode()).equals(s)) { - enabledSubtypes.add(ims); + if (imi != null) { + for (Pair<String, ArrayList<String>> imsPair : imsList) { + InputMethodInfo info = mMethodMap.get(imsPair.first); + if (info != null && info.getId().equals(imi.getId())) { + ArrayList<InputMethodSubtype> subtypes = info.getSubtypes(); + for (InputMethodSubtype ims: subtypes) { + for (String s: imsPair.second) { + if (String.valueOf(ims.hashCode()).equals(s)) { + enabledSubtypes.add(ims); + } } } + break; } - break; } } return enabledSubtypes; |
