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

Commit 200feaee authored by Vaibhav Devmurari's avatar Vaibhav Devmurari
Browse files

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
parent fbc06111
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -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();
    }

    /**
+0 −8
Original line number Diff line number Diff line
@@ -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) {