diff options
Diffstat (limited to 'java/src/com/android/inputmethod/latin/ImfUtils.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/ImfUtils.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/ImfUtils.java b/java/src/com/android/inputmethod/latin/ImfUtils.java index af46a02c0..36f6d8ba0 100644 --- a/java/src/com/android/inputmethod/latin/ImfUtils.java +++ b/java/src/com/android/inputmethod/latin/ImfUtils.java @@ -63,7 +63,8 @@ public class ImfUtils { return getInputMethodInfoOfThisIme(context).getId(); } - public static boolean checkIfSubtypeBelongsToThisIme(Context context, InputMethodSubtype ims) { + public static boolean checkIfSubtypeBelongsToThisImeAndEnabled(Context context, + InputMethodSubtype ims) { final InputMethodInfo myImi = getInputMethodInfoOfThisIme(context); final InputMethodManager imm = getInputMethodManager(context); // TODO: Cache all subtypes of this IME for optimization @@ -76,6 +77,19 @@ public class ImfUtils { return false; } + public static boolean checkIfSubtypeBelongsToThisIme(Context context, + InputMethodSubtype ims) { + final InputMethodInfo myImi = getInputMethodInfoOfThisIme(context); + final int count = myImi.getSubtypeCount(); + for (int i = 0; i < count; i++) { + final InputMethodSubtype subtype = myImi.getSubtypeAt(i); + if (subtype.equals(ims)) { + return true; + } + } + return false; + } + public static boolean hasMultipleEnabledIMEsOrSubtypes(Context context, final boolean shouldIncludeAuxiliarySubtypes) { final InputMethodManager imm = getInputMethodManager(context); |