From 1e1a447000263151822b67a4981cd854fa8cb3c5 Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Thu, 10 Mar 2016 23:46:07 -0800 Subject: [PATCH] Persist isAsciiCapable attribute of additional subtypes. This was somehow missed in the previous commit [1] that added isAsciiCapable attribute to InputMethodSubtype. For devices from API level 14 to 23, IME developers might be able to work around this issue by specifying "AsciiCapable" [2] in imeSubtypeExtraValue, which is not coverted by CTS though. [1]: Ic3ace4b6e0432d56696bcbc0be336aec1dc744a5 dc8abf6cee0bcf44e2cad8155f0c151105d46471 [2]: I0bc9954f163a3ec38d08b9ba842a8a31176eb6a6 8e303cc5dd4860b6050d5725ce60ca7e6fb00c7b Bug: 27603986 Change-Id: Ifb6bc83e782ac05df180dfe0d689897d07441a0c --- .../java/com/android/server/InputMethodManagerService.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/core/java/com/android/server/InputMethodManagerService.java b/services/core/java/com/android/server/InputMethodManagerService.java index a93b4d8bc250e..9b8f2d2d7d573 100644 --- a/services/core/java/com/android/server/InputMethodManagerService.java +++ b/services/core/java/com/android/server/InputMethodManagerService.java @@ -3588,6 +3588,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub private static final String ATTR_IME_SUBTYPE_MODE = "imeSubtypeMode"; private static final String ATTR_IME_SUBTYPE_EXTRA_VALUE = "imeSubtypeExtraValue"; private static final String ATTR_IS_AUXILIARY = "isAuxiliary"; + private static final String ATTR_IS_ASCII_CAPABLE = "isAsciiCapable"; private final AtomicFile mAdditionalInputMethodSubtypeFile; private final HashMap mMethodMap; private final HashMap> mAdditionalSubtypesMap = @@ -3684,6 +3685,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub out.attribute(null, ATTR_IME_SUBTYPE_EXTRA_VALUE, subtype.getExtraValue()); out.attribute(null, ATTR_IS_AUXILIARY, String.valueOf(subtype.isAuxiliary() ? 1 : 0)); + out.attribute(null, ATTR_IS_ASCII_CAPABLE, + String.valueOf(subtype.isAsciiCapable() ? 1 : 0)); out.endTag(null, NODE_SUBTYPE); } out.endTag(null, NODE_IMI); @@ -3749,6 +3752,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub parser.getAttributeValue(null, ATTR_IME_SUBTYPE_EXTRA_VALUE); final boolean isAuxiliary = "1".equals(String.valueOf( parser.getAttributeValue(null, ATTR_IS_AUXILIARY))); + final boolean isAsciiCapable = "1".equals(String.valueOf( + parser.getAttributeValue(null, ATTR_IS_ASCII_CAPABLE))); final InputMethodSubtype subtype = new InputMethodSubtypeBuilder() .setSubtypeNameResId(label) .setSubtypeIconResId(icon) @@ -3757,6 +3762,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub .setSubtypeMode(imeSubtypeMode) .setSubtypeExtraValue(imeSubtypeExtraValue) .setIsAuxiliary(isAuxiliary) + .setIsAsciiCapable(isAsciiCapable) .build(); tempSubtypesArray.add(subtype); }