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

Commit 51f275d8 authored by Satoshi Kataoka's avatar Satoshi Kataoka
Browse files

Set EmojiCapable

Bug: 10240645
Change-Id: I891309c2a82f8d10f8fdb0872403a7a235e27b5f
parent d2cafb03
Loading
Loading
Loading
Loading
+64 −64

File changed.

Preview size limit exceeded, changes collapsed.

+5 −0
Original line number Diff line number Diff line
@@ -75,6 +75,11 @@ public final class Constants {
             */
            public static final String ASCII_CAPABLE = "AsciiCapable";

            /**
             * The subtype extra value used to indicate that the subtype keyboard layout is capable
             * for typing EMOJI characters.
             */
            public static final String EMOJI_CAPABLE = "EmojiCapable";
            /**
             * The subtype extra value used to indicate that the subtype require network connection
             * to work.
+8 −5
Original line number Diff line number Diff line
@@ -59,16 +59,19 @@ public final class SubtypeSwitcher {
    // Dummy no language QWERTY subtype. See {@link R.xml.method}.
    private static final InputMethodSubtype DUMMY_NO_LANGUAGE_SUBTYPE = new InputMethodSubtype(
            R.string.subtype_no_language_qwerty, R.drawable.ic_subtype_keyboard,
            SubtypeLocaleUtils.NO_LANGUAGE, "keyboard",
            "KeyboardLayoutSet=" + SubtypeLocaleUtils.QWERTY
            + ",AsciiCapable,EnabledWhenDefaultIsNotAsciiCapable",
            SubtypeLocaleUtils.NO_LANGUAGE, "keyboard", "KeyboardLayoutSet="
                    + SubtypeLocaleUtils.QWERTY
                    + "," + Constants.Subtype.ExtraValue.ASCII_CAPABLE
                    + ",EnabledWhenDefaultIsNotAsciiCapable,"
                    + Constants.Subtype.ExtraValue.EMOJI_CAPABLE,
            false /* isAuxiliary */, false /* overridesImplicitlyEnabledSubtype */);
    // Caveat: We probably should remove this when we add an Emoji subtype in {@link R.xml.method}.
    // Dummy Emoji subtype. See {@link R.xml.method}.
    private static final InputMethodSubtype DUMMY_EMOJI_SUBTYPE = new InputMethodSubtype(
            R.string.subtype_emoji, R.drawable.ic_subtype_keyboard,
            SubtypeLocaleUtils.NO_LANGUAGE, "keyboard",
            "KeyboardLayoutSet=" + SubtypeLocaleUtils.EMOJI,
            SubtypeLocaleUtils.NO_LANGUAGE, "keyboard", "KeyboardLayoutSet="
                    + SubtypeLocaleUtils.EMOJI + ","
                    + Constants.Subtype.ExtraValue.EMOJI_CAPABLE,
            false /* isAuxiliary */, false /* overridesImplicitlyEnabledSubtype */);

    static final class NeedsToDisplayLanguage {
+4 −2
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.os.Build;
import android.text.TextUtils;
import android.view.inputmethod.InputMethodSubtype;

import com.android.inputmethod.latin.Constants;
import com.android.inputmethod.latin.R;

import java.util.ArrayList;
@@ -61,8 +62,9 @@ public final class AdditionalSubtypeUtils {
                        IS_ADDITIONAL_SUBTYPE, layoutDisplayNameExtraValue);
        final int nameId = SubtypeLocaleUtils.getSubtypeNameId(localeString, keyboardLayoutSetName);
        return new InputMethodSubtype(nameId, R.drawable.ic_subtype_keyboard,
                localeString, KEYBOARD_MODE,
                layoutExtraValue + "," + additionalSubtypeExtraValue, false, false);
                localeString, KEYBOARD_MODE, layoutExtraValue + "," + additionalSubtypeExtraValue
                        + "," + Constants.Subtype.ExtraValue.ASCII_CAPABLE
                        + "," + Constants.Subtype.ExtraValue.EMOJI_CAPABLE, false, false);
    }

    public static String getPrefSubtype(final InputMethodSubtype subtype) {