From 9b4157935af9e44571187a9533c2cc9b413383bf Mon Sep 17 00:00:00 2001 From: satok Date: Mon, 30 May 2011 12:37:52 +0900 Subject: [PATCH] Use isAuxiliary instead of ExtraValue for the auxiliary subtypes. Change-Id: Ibce4f884e697ca789b9942cf3abad43741040a87 --- api/current.txt | 1 + core/res/res/values/attrs.xml | 5 +++++ core/res/res/values/public.xml | 1 + .../com/android/server/InputMethodManagerService.java | 9 +++------ 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/api/current.txt b/api/current.txt index 7dcb71481ed89..1e90e477f43cd 100644 --- a/api/current.txt +++ b/api/current.txt @@ -526,6 +526,7 @@ package android { field public static final int installLocation = 16843447; // 0x10102b7 field public static final int interpolator = 16843073; // 0x1010141 field public static final int isAlwaysSyncable = 16843571; // 0x1010333 + field public static final int isAuxiliary = 16843641; // 0x1010379 field public static final int isDefault = 16843297; // 0x1010221 field public static final int isIndicator = 16843079; // 0x1010147 field public static final int isModifier = 16843334; // 0x1010246 diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index b82a2d27013ae..bbbca3781713f 100755 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -2137,6 +2137,11 @@ string will be passed to the IME when the framework calls the IME with the subtype. --> + + diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index 0bd939ed5d9bc..5f72da570762c 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -1685,4 +1685,5 @@ + diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java index 465fd2e608dd2..c96273b2c6293 100644 --- a/services/java/com/android/server/InputMethodManagerService.java +++ b/services/java/com/android/server/InputMethodManagerService.java @@ -126,10 +126,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub private static final String SUBTYPE_MODE_KEYBOARD = "keyboard"; private static final String SUBTYPE_MODE_VOICE = "voice"; - // TODO: Will formalize this value as API - private static final String SUBTYPE_EXTRAVALUE_EXCLUDE_FROM_LAST_IME = - "excludeFromLastInputMethod"; - final Context mContext; final Resources mRes; final Handler mHandler; @@ -1883,7 +1879,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub final int subtypeCount = imi.getSubtypeCount(); for (int j = 0; j < subtypeCount; ++j) { InputMethodSubtype subtype = imi.getSubtypeAt(j); - if (enabledSubtypeSet.contains(String.valueOf(subtype.hashCode()))) { + if (enabledSubtypeSet.contains(String.valueOf(subtype.hashCode())) + && !subtype.isAuxiliary()) { final CharSequence title; int nameResId = subtype.getNameResId(); String mode = subtype.getMode(); @@ -2078,7 +2075,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub private boolean canAddToLastInputMethod(InputMethodSubtype subtype) { if (subtype == null) return true; - return !subtype.containsExtraValueKey(SUBTYPE_EXTRAVALUE_EXCLUDE_FROM_LAST_IME); + return !subtype.isAuxiliary(); } private void saveCurrentInputMethodAndSubtypeToHistory() {