diff --git a/src/com/android/settings/inputmethod/NewKeyboardLayoutEnabledLocalesFragment.java b/src/com/android/settings/inputmethod/NewKeyboardLayoutEnabledLocalesFragment.java index 849ffb46855..7a5885756dd 100644 --- a/src/com/android/settings/inputmethod/NewKeyboardLayoutEnabledLocalesFragment.java +++ b/src/com/android/settings/inputmethod/NewKeyboardLayoutEnabledLocalesFragment.java @@ -169,6 +169,19 @@ public class NewKeyboardLayoutEnabledLocalesFragment extends DashboardFragment preferenceScreen.removeAll(); List infoList = mImm.getEnabledInputMethodListAsUser(UserHandle.of(mUserId)); + + // Remove IMEs with no suitable ime subtypes + infoList.removeIf(imeInfo -> { + List subtypes = + mImm.getEnabledInputMethodSubtypeListAsUser(imeInfo.getId(), true, + UserHandle.of(mUserId)); + for (InputMethodSubtype subtype : subtypes) { + if (subtype.isSuitableForPhysicalKeyboardLayoutMapping()) { + return false; + } + } + return true; + }); Collections.sort(infoList, new Comparator() { public int compare(InputMethodInfo o1, InputMethodInfo o2) { String s1 = o1.loadLabel(mContext.getPackageManager()).toString();