Add SubtypeUtils.setAditionalInputMethodSubtypes method

Change-Id: Ia3043346ed87297e01d505980555fdf29ce4f96f
main
Tadashi G. Takaoka 2012-04-17 22:48:00 +09:00
parent 74a84febc7
commit 69bcc15cb3
2 changed files with 12 additions and 3 deletions

View File

@ -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 */);

View File

@ -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);
}
}