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

Commit 69bcc15c authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

Add SubtypeUtils.setAditionalInputMethodSubtypes method

Change-Id: Ia3043346ed87297e01d505980555fdf29ce4f96f
parent 74a84feb
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -442,9 +442,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen

        loadSettings();

        mImm.setAdditionalInputMethodSubtypes(
                SubtypeUtils.getInputMethodId(getPackageName()),
                mSettingsValues.getPrefefinedAdditionalSubtypes());
        SubtypeUtils.setAditionalInputMethodSubtypes(
                this, mSettingsValues.getPrefefinedAdditionalSubtypes());

        // TODO: remove the following when it's not needed by updateCorrectionMode() any more
        mInputAttributes = new InputAttributes(null, false /* isFullscreenMode */);
+10 −0
Original line number Diff line number Diff line
@@ -146,4 +146,14 @@ public class SubtypeUtils {
        throw new RuntimeException("Can't find subtype for locale " + localeString
                + " and keyboard layout " + keyoardLayoutSet);
    }

    public static void setAditionalInputMethodSubtypes(Context context,
            InputMethodSubtype[] subtypes) {
        final InputMethodManagerCompatWrapper imm = InputMethodManagerCompatWrapper.getInstance();
        if (imm == null) {
            throw new RuntimeException("Input method manager not found");
        }
        final String imiId = getInputMethodId(context.getPackageName());
        imm.setAdditionalInputMethodSubtypes(imiId, subtypes);
    }
}