Allow ImeSutype with null languagtag to be passed to IMS

Imesubtypes with null languagtag should be allowed to be set.
If ImeSubtype is null, user can still select a PK layout for it
in the settings and we need the callbacks so that when user
switches to that particular ImeSubtype, we select the user
selected layout.

Test: atest InputMethodSubtypeTest
Bug: 20805588
Change-Id: I8541e6132bdf04245831010f11ceabb651dd34ca
This commit is contained in:
Vaibhav Devmurari
2023-01-02 21:54:58 +00:00
parent fbc06111b9
commit 200feaeef3
2 changed files with 1 additions and 16 deletions

View File

@@ -536,14 +536,7 @@ public final class InputMethodSubtype implements Parcelable {
if (!TextUtils.equals(getMode(), SUBTYPE_MODE_KEYBOARD)) {
return false;
}
if (isAuxiliary()) {
return false;
}
final String langTag = getCanonicalizedLanguageTag();
if (langTag.isEmpty() || TextUtils.equals(langTag, UNDEFINED_LANGUAGE_TAG)) {
return false;
}
return true;
return !isAuxiliary();
}
/**

View File

@@ -176,14 +176,6 @@ public class InputMethodSubtypeTest {
// Auxiliary subtype not suitable.
assertFalse(getValidBuilder.get().setIsAuxiliary(true).build()
.isSuitableForPhysicalKeyboardLayoutMapping());
// languageTag == null is not suitable.
assertFalse(getValidBuilder.get().setLanguageTag(null).build()
.isSuitableForPhysicalKeyboardLayoutMapping());
// languageTag == "und" is not suitable.
assertFalse(getValidBuilder.get().setLanguageTag("und").build()
.isSuitableForPhysicalKeyboardLayoutMapping());
}
private static InputMethodSubtype cloneViaParcel(final InputMethodSubtype original) {