Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e1a4470 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

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
       dc8abf6c
  [2]: I0bc9954f163a3ec38d08b9ba842a8a31176eb6a6
       8e303cc5

Bug: 27603986
Change-Id: Ifb6bc83e782ac05df180dfe0d689897d07441a0c
parent a871c310
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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<String, InputMethodInfo> mMethodMap;
        private final HashMap<String, List<InputMethodSubtype>> 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);
                    }