diff options
author | satok <satok@google.com> | 2011-01-17 16:29:02 +0900 |
---|---|---|
committer | satok <satok@google.com> | 2011-01-17 16:29:02 +0900 |
commit | f6cafb63753a26440cb3ad2e5124370aef650015 (patch) | |
tree | b97e1cc54eef73e16c24f0632adb720b285deba3 | |
parent | bdac9e0fbe874cf7414228624bd0d3af4f715ccc (diff) | |
download | frameworks_base-f6cafb63753a26440cb3ad2e5124370aef650015.zip frameworks_base-f6cafb63753a26440cb3ad2e5124370aef650015.tar.gz frameworks_base-f6cafb63753a26440cb3ad2e5124370aef650015.tar.bz2 |
Implicitly/Explicitly subtypes bug.
Change-Id: I6ccc22d4272ee92c0d8ba3f3c724d8f838d51310
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodsPanel.java | 3 | ||||
-rw-r--r-- | services/java/com/android/server/InputMethodManagerService.java | 12 |
2 files changed, 8 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodsPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodsPanel.java index d4ba693..add67b1 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodsPanel.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodsPanel.java @@ -242,6 +242,7 @@ public class InputMethodsPanel extends LinearLayout implements StatusBarPanel, O // Turn on the selected radio button at startup private void updateRadioButtonsByImiAndSubtype( InputMethodInfo imi, InputMethodSubtype subtype) { + if (imi == null) return; if (DEBUG) { Log.d(TAG, "Update radio buttons by " + imi.getId() + ", " + subtype); } @@ -253,7 +254,7 @@ public class InputMethodsPanel extends LinearLayout implements StatusBarPanel, O return; } Pair<InputMethodInfo, InputMethodSubtype> imiAndSubtype = - mRadioViewAndImiMap.get(radioView); + mRadioViewAndImiMap.get(radioView); if (imiAndSubtype.first.getId().equals(imi.getId()) && (imiAndSubtype.second == null || imiAndSubtype.second.equals(subtype))) { subtypeRadioButton.setChecked(true); diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java index 2b98795..7b4f246 100644 --- a/services/java/com/android/server/InputMethodManagerService.java +++ b/services/java/com/android/server/InputMethodManagerService.java @@ -2540,16 +2540,16 @@ public class InputMethodManagerService extends IInputMethodManager.Stub ArrayList<String>>> enabledImes, String imeId, String subtypeHashCode) { for (Pair<String, ArrayList<String>> enabledIme: enabledImes) { if (enabledIme.first.equals(imeId)) { - final ArrayList<String> enabledSubtypes = enabledIme.second; - if (enabledSubtypes.size() == 0) { - // If there are no enabled subtypes, applicable subtypes are enabled - // implicitly. + final ArrayList<String> explicitlyEnabledSubtypes = enabledIme.second; + if (explicitlyEnabledSubtypes.size() == 0) { + // If there are no explicitly enabled subtypes, applicable subtypes are + // enabled implicitly. InputMethodInfo ime = mMethodMap.get(imeId); // If IME is enabled and no subtypes are enabled, applicable subtypes // are enabled implicitly, so needs to treat them to be enabled. if (ime != null && ime.getSubtypes().size() > 0) { List<InputMethodSubtype> implicitlySelectedSubtypes = - getApplicableSubtypesLocked(mRes, ime.getSubtypes()); + getApplicableSubtypesLocked(mRes, ime.getSubtypes()); if (implicitlySelectedSubtypes != null) { final int N = implicitlySelectedSubtypes.size(); for (int i = 0; i < N; ++i) { @@ -2561,7 +2561,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } } } else { - for (String s: enabledSubtypes) { + for (String s: explicitlyEnabledSubtypes) { if (s.equals(subtypeHashCode)) { // If both imeId and subtypeId are enabled, return subtypeId. return s; |