Use isAuxiliary instead of ExtraValue for the auxiliary subtypes.
Change-Id: Ibce4f884e697ca789b9942cf3abad43741040a87
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -2137,6 +2137,11 @@
|
||||
string will be passed to the IME when the framework calls the IME with the
|
||||
subtype. -->
|
||||
<attr name="imeSubtypeMode" format="string" />
|
||||
<!-- Set true if the subtype is auxiliary. An auxiliary subtype won't be shown in the
|
||||
input method selection list in the settings app.
|
||||
InputMethodManager#switchToLastInputMethod will ignore auxiliary subtypes when it
|
||||
chooses a target subtype. -->
|
||||
<attr name="isAuxiliary" format="boolean" />
|
||||
<!-- The extra value of the subtype. This string can be any string and will be passed to
|
||||
the IME when the framework calls the IME with the subtype. -->
|
||||
<attr name="imeSubtypeExtraValue" format="string" />
|
||||
|
||||
@@ -1685,4 +1685,5 @@
|
||||
<public type="attr" name="layout_columnSpan" />
|
||||
<public type="attr" name="layout_columnWeight" />
|
||||
|
||||
<public type="attr" name="isAuxiliary" />
|
||||
</resources>
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user