aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java5
-rw-r--r--java/src/com/android/inputmethod/latin/SubtypeUtils.java10
2 files changed, 12 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index b30d1e35c..ddf21f749 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -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 */);
diff --git a/java/src/com/android/inputmethod/latin/SubtypeUtils.java b/java/src/com/android/inputmethod/latin/SubtypeUtils.java
index 4d0f1c262..a361027af 100644
--- a/java/src/com/android/inputmethod/latin/SubtypeUtils.java
+++ b/java/src/com/android/inputmethod/latin/SubtypeUtils.java
@@ -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);
+ }
}