Add SubtypeUtils.setAditionalInputMethodSubtypes method
Change-Id: Ia3043346ed87297e01d505980555fdf29ce4f96fmain
parent
74a84febc7
commit
69bcc15cb3
|
@ -442,9 +442,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
|
|
||||||
loadSettings();
|
loadSettings();
|
||||||
|
|
||||||
mImm.setAdditionalInputMethodSubtypes(
|
SubtypeUtils.setAditionalInputMethodSubtypes(
|
||||||
SubtypeUtils.getInputMethodId(getPackageName()),
|
this, mSettingsValues.getPrefefinedAdditionalSubtypes());
|
||||||
mSettingsValues.getPrefefinedAdditionalSubtypes());
|
|
||||||
|
|
||||||
// TODO: remove the following when it's not needed by updateCorrectionMode() any more
|
// TODO: remove the following when it's not needed by updateCorrectionMode() any more
|
||||||
mInputAttributes = new InputAttributes(null, false /* isFullscreenMode */);
|
mInputAttributes = new InputAttributes(null, false /* isFullscreenMode */);
|
||||||
|
|
|
@ -146,4 +146,14 @@ public class SubtypeUtils {
|
||||||
throw new RuntimeException("Can't find subtype for locale " + localeString
|
throw new RuntimeException("Can't find subtype for locale " + localeString
|
||||||
+ " and keyboard layout " + keyoardLayoutSet);
|
+ " 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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue