diff options
| author | satok <satok@google.com> | 2011-10-03 17:05:50 +0900 |
|---|---|---|
| committer | satok <satok@google.com> | 2011-10-03 17:49:57 +0900 |
| commit | 4a553e3a70d26fac5d7b7ec1142e0cabfdd66670 (patch) | |
| tree | b4c53f467dd302601c9149f33f963a5ea697dae4 | |
| parent | 53b1aaaa08ed0cfd20e45707917bfe3d53529839 (diff) | |
| download | frameworks_base-4a553e3a70d26fac5d7b7ec1142e0cabfdd66670.zip frameworks_base-4a553e3a70d26fac5d7b7ec1142e0cabfdd66670.tar.gz frameworks_base-4a553e3a70d26fac5d7b7ec1142e0cabfdd66670.tar.bz2 | |
Prioritize the order of subtypes in method.xml for implicitly enabled subtypes
Bug: 5401115
Change-Id: I6d9229cd266e27b68a6b9a2892aabfba4fe4de00
| -rw-r--r-- | services/java/com/android/server/InputMethodManagerService.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java index bc145b1..3e1fb9f 100644 --- a/services/java/com/android/server/InputMethodManagerService.java +++ b/services/java/com/android/server/InputMethodManagerService.java @@ -2426,7 +2426,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub final List<InputMethodSubtype> subtypes = getSubtypes(imi); final String systemLocale = res.getConfiguration().locale.toString(); if (TextUtils.isEmpty(systemLocale)) return new ArrayList<InputMethodSubtype>(); - HashMap<String, InputMethodSubtype> applicableModeAndSubtypesMap = + final HashMap<String, InputMethodSubtype> applicableModeAndSubtypesMap = new HashMap<String, InputMethodSubtype>(); final int N = subtypes.size(); boolean containsKeyboardSubtype = false; @@ -2444,7 +2444,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub return new ArrayList<InputMethodSubtype>(applicableModeAndSubtypesMap.values()); } for (int i = 0; i < N; ++i) { - InputMethodSubtype subtype = subtypes.get(i); + final InputMethodSubtype subtype = subtypes.get(i); final String locale = subtype.getLocale(); final String mode = subtype.getMode(); // When system locale starts with subtype's locale, that subtype will be applicable @@ -2456,10 +2456,12 @@ public class InputMethodManagerService extends IInputMethodManager.Stub // need to find applicable subtypes aggressively unlike // findLastResortApplicableSubtypeLocked. if (systemLocale.startsWith(locale)) { - InputMethodSubtype applicableSubtype = applicableModeAndSubtypesMap.get(mode); + final InputMethodSubtype applicableSubtype = applicableModeAndSubtypesMap.get(mode); // If more applicable subtypes are contained, skip. - if (applicableSubtype != null - && systemLocale.equals(applicableSubtype.getLocale())) continue; + if (applicableSubtype != null) { + if (systemLocale.equals(applicableSubtype.getLocale())) continue; + if (!systemLocale.equals(locale)) continue; + } applicableModeAndSubtypesMap.put(mode, subtype); if (!containsKeyboardSubtype && SUBTYPE_MODE_KEYBOARD.equalsIgnoreCase(subtype.getMode())) { |
