From 55d28fd1b2631a63542a647f693d8a8ed749bcf7 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Wed, 18 Apr 2012 17:39:57 +0900 Subject: Cleanup InputMethodManagerCompatWrapper Change-Id: Id3b84ee19bb504ed8fbb398e260cc663a5b5ae0d --- .../compat/InputMethodManagerCompatWrapper.java | 46 +----- .../inputmethod/keyboard/LatinKeyboardView.java | 9 +- .../com/android/inputmethod/latin/ImfUtils.java | 163 +++++++++++++++++++++ .../com/android/inputmethod/latin/LatinIME.java | 10 +- .../android/inputmethod/latin/SettingsValues.java | 5 +- .../android/inputmethod/latin/SubtypeSwitcher.java | 10 +- .../android/inputmethod/latin/SubtypeUtils.java | 158 -------------------- 7 files changed, 188 insertions(+), 213 deletions(-) create mode 100644 java/src/com/android/inputmethod/latin/ImfUtils.java delete mode 100644 java/src/com/android/inputmethod/latin/SubtypeUtils.java (limited to 'java/src') diff --git a/java/src/com/android/inputmethod/compat/InputMethodManagerCompatWrapper.java b/java/src/com/android/inputmethod/compat/InputMethodManagerCompatWrapper.java index 4bc82d2ec..cc10a4ed2 100644 --- a/java/src/com/android/inputmethod/compat/InputMethodManagerCompatWrapper.java +++ b/java/src/com/android/inputmethod/compat/InputMethodManagerCompatWrapper.java @@ -18,14 +18,12 @@ package com.android.inputmethod.compat; import android.content.Context; import android.os.IBinder; -import android.util.Log; -import android.view.inputmethod.InputMethodInfo; import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodSubtype; +import com.android.inputmethod.latin.ImfUtils; + import java.lang.reflect.Method; -import java.util.List; -import java.util.Map; // TODO: Override this class with the concrete implementation if we need to take care of the // performance. @@ -44,41 +42,20 @@ public class InputMethodManagerCompatWrapper { } public static InputMethodManagerCompatWrapper getInstance() { - if (sInstance.mImm == null) - Log.w(TAG, "getInstance() is called before initialization"); + if (sInstance.mImm == null) { + throw new RuntimeException(TAG + ".getInstance() is called before initialization"); + } return sInstance; } public static void init(Context context) { - sInstance.mImm = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE); - } - - public void setAdditionalInputMethodSubtypes(String imiId, InputMethodSubtype[] subtypes) { - mImm.setAdditionalInputMethodSubtypes(imiId, subtypes); - } - - public InputMethodSubtype getCurrentInputMethodSubtype() { - return mImm.getCurrentInputMethodSubtype(); + sInstance.mImm = ImfUtils.getInputMethodManager(context); } public InputMethodSubtype getLastInputMethodSubtype() { return mImm.getLastInputMethodSubtype(); } - public List getEnabledInputMethodSubtypeList( - InputMethodInfo imi, boolean allowsImplicitlySelectedSubtypes) { - return mImm.getEnabledInputMethodSubtypeList(imi, allowsImplicitlySelectedSubtypes); - } - - public Map> getShortcutInputMethodsAndSubtypes() { - return mImm.getShortcutInputMethodsAndSubtypes(); - } - - // We don't call this method when we switch between subtypes within this IME. - public void setInputMethodAndSubtype(IBinder token, String id, InputMethodSubtype subtype) { - mImm.setInputMethodAndSubtype(token, id, subtype); - } - public boolean switchToLastInputMethod(IBinder token) { return mImm.switchToLastInputMethod(token); } @@ -88,18 +65,7 @@ public class InputMethodManagerCompatWrapper { onlyCurrentIme); } - public List getInputMethodList() { - if (mImm == null) return null; - return mImm.getInputMethodList(); - } - - public List getEnabledInputMethodList() { - if (mImm == null) return null; - return mImm.getEnabledInputMethodList(); - } - public void showInputMethodPicker() { - if (mImm == null) return; mImm.showInputMethodPicker(); } } diff --git a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java index 80a8c040c..efb0d77ea 100644 --- a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java @@ -42,13 +42,13 @@ import com.android.inputmethod.accessibility.AccessibilityUtils; import com.android.inputmethod.accessibility.AccessibleKeyboardViewProxy; import com.android.inputmethod.keyboard.PointerTracker.DrawingProxy; import com.android.inputmethod.keyboard.PointerTracker.TimerProxy; +import com.android.inputmethod.latin.ImfUtils; import com.android.inputmethod.latin.LatinIME; import com.android.inputmethod.latin.LatinImeLogger; import com.android.inputmethod.latin.R; import com.android.inputmethod.latin.ResearchLogger; import com.android.inputmethod.latin.StaticInnerHandlerWrapper; import com.android.inputmethod.latin.SubtypeLocale; -import com.android.inputmethod.latin.SubtypeUtils; import com.android.inputmethod.latin.Utils; import com.android.inputmethod.latin.Utils.UsabilityStudyLogUtils; import com.android.inputmethod.latin.define.ProductionFlag; @@ -877,13 +877,14 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke // Whether space key needs to show the "..." popup hint for special purposes if (mIsSpacebarTriggeringPopupByLongPress - && SubtypeUtils.hasMultipleEnabledIMEsOrSubtypes( - true /* include aux subtypes */)) { + && ImfUtils.hasMultipleEnabledIMEsOrSubtypes( + getContext(), true /* include aux subtypes */)) { drawKeyPopupHint(key, canvas, paint, params); } } else if (key.mCode == Keyboard.CODE_LANGUAGE_SWITCH) { super.onDrawKeyTopVisuals(key, canvas, paint, params); - if (SubtypeUtils.hasMultipleEnabledIMEsOrSubtypes(true /* include aux subtypes */)) { + if (ImfUtils.hasMultipleEnabledIMEsOrSubtypes( + getContext(), true /* include aux subtypes */)) { drawKeyPopupHint(key, canvas, paint, params); } } else { diff --git a/java/src/com/android/inputmethod/latin/ImfUtils.java b/java/src/com/android/inputmethod/latin/ImfUtils.java new file mode 100644 index 000000000..bd7d89fe7 --- /dev/null +++ b/java/src/com/android/inputmethod/latin/ImfUtils.java @@ -0,0 +1,163 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.inputmethod.latin; + +import android.content.Context; +import android.view.inputmethod.InputMethodInfo; +import android.view.inputmethod.InputMethodManager; +import android.view.inputmethod.InputMethodSubtype; + +import java.util.Collections; +import java.util.List; + +/** + * Utility class for Input Method Framework + */ +public class ImfUtils { + private ImfUtils() { + // This utility class is not publicly instantiable. + } + + private static InputMethodManager sInputMethodManager; + + public static InputMethodManager getInputMethodManager(Context context) { + if (sInputMethodManager == null) { + sInputMethodManager = (InputMethodManager)context.getSystemService( + Context.INPUT_METHOD_SERVICE); + } + return sInputMethodManager; + } + + private static InputMethodInfo sInputMethodInfoOfThisIme; + + public static InputMethodInfo getInputMethodInfoOfThisIme(Context context) { + if (sInputMethodInfoOfThisIme == null) { + final InputMethodManager imm = getInputMethodManager(context); + final String packageName = context.getPackageName(); + for (final InputMethodInfo imi : imm.getInputMethodList()) { + if (imi.getPackageName().equals(packageName)) + return imi; + } + throw new RuntimeException("Can not find input method id for " + packageName); + } + return sInputMethodInfoOfThisIme; + } + + public static String getInputMethodIdOfThisIme(Context context) { + return getInputMethodInfoOfThisIme(context).getId(); + } + + public static boolean checkIfSubtypeBelongsToThisIme(Context context, InputMethodSubtype ims) { + final InputMethodInfo myImi = getInputMethodInfoOfThisIme(context); + final InputMethodManager imm = getInputMethodManager(context); + final List subtypes = imm.getEnabledInputMethodSubtypeList(myImi, true); + for (final InputMethodSubtype subtype : subtypes) { + if (subtype.equals(ims)) { + return true; + } + } + return false; + } + + public static boolean hasMultipleEnabledIMEsOrSubtypes(Context context, + final boolean shouldIncludeAuxiliarySubtypes) { + final InputMethodManager imm = getInputMethodManager(context); + final List enabledImis = imm.getEnabledInputMethodList(); + return hasMultipleEnabledSubtypes(context, shouldIncludeAuxiliarySubtypes, enabledImis); + } + + public static boolean hasMultipleEnabledSubtypesInThisIme(Context context, + final boolean shouldIncludeAuxiliarySubtypes) { + final InputMethodInfo myImi = getInputMethodInfoOfThisIme(context); + final List imiList = Collections.singletonList(myImi); + return hasMultipleEnabledSubtypes(context, shouldIncludeAuxiliarySubtypes, imiList); + } + + private static boolean hasMultipleEnabledSubtypes(Context context, + final boolean shouldIncludeAuxiliarySubtypes, List imiList) { + final InputMethodManager imm = getInputMethodManager(context); + + // Number of the filtered IMEs + int filteredImisCount = 0; + + for (InputMethodInfo imi : imiList) { + // We can return true immediately after we find two or more filtered IMEs. + if (filteredImisCount > 1) return true; + final List subtypes = + imm.getEnabledInputMethodSubtypeList(imi, true); + // IMEs that have no subtypes should be counted. + if (subtypes.isEmpty()) { + ++filteredImisCount; + continue; + } + + int auxCount = 0; + for (InputMethodSubtype subtype : subtypes) { + if (subtype.isAuxiliary()) { + ++auxCount; + } + } + final int nonAuxCount = subtypes.size() - auxCount; + + // IMEs that have one or more non-auxiliary subtypes should be counted. + // If shouldIncludeAuxiliarySubtypes is true, IMEs that have two or more auxiliary + // subtypes should be counted as well. + if (nonAuxCount > 0 || (shouldIncludeAuxiliarySubtypes && auxCount > 1)) { + ++filteredImisCount; + continue; + } + } + + if (filteredImisCount > 1) { + return true; + } + final List subtypes = imm.getEnabledInputMethodSubtypeList(null, true); + int keyboardCount = 0; + // imm.getEnabledInputMethodSubtypeList(null, true) will return the current IME's + // both explicitly and implicitly enabled input method subtype. + // (The current IME should be LatinIME.) + for (InputMethodSubtype subtype : subtypes) { + if (SubtypeSwitcher.KEYBOARD_MODE.equals(subtype.getMode())) { + ++keyboardCount; + } + } + return keyboardCount > 1; + } + + public static InputMethodSubtype findSubtypeByLocaleAndKeyboardLayoutSet( + Context context, String localeString, String keyboardLayoutSetName) { + final InputMethodInfo imi = getInputMethodInfoOfThisIme(context); + final int count = imi.getSubtypeCount(); + for (int i = 0; i < count; i++) { + final InputMethodSubtype subtype = imi.getSubtypeAt(i); + final String layoutName = SubtypeLocale.getKeyboardLayoutSetName(subtype); + if (localeString.equals(subtype.getLocale()) + && keyboardLayoutSetName.equals(layoutName)) { + return subtype; + } + } + throw new RuntimeException("Can't find subtype for locale " + localeString + + " and keyboard layout " + keyboardLayoutSetName); + } + + public static void setAdditionalInputMethodSubtypes(Context context, + InputMethodSubtype[] subtypes) { + final InputMethodManager imm = getInputMethodManager(context); + final String imiId = getInputMethodIdOfThisIme(context); + imm.setAdditionalInputMethodSubtypes(imiId, subtypes); + } +} diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index deb956753..aea6add56 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -441,7 +441,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen loadSettings(); - SubtypeUtils.setAdditionalInputMethodSubtypes( + ImfUtils.setAdditionalInputMethodSubtypes( this, mSettingsValues.getPrefefinedAdditionalSubtypes()); // TODO: remove the following when it's not needed by updateCorrectionMode() any more @@ -1134,7 +1134,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen if (isShowingOptionDialog()) return false; switch (requestCode) { case CODE_SHOW_INPUT_METHOD_PICKER: - if (SubtypeUtils.hasMultipleEnabledIMEsOrSubtypes(true /* include aux subtypes */)) { + if (ImfUtils.hasMultipleEnabledIMEsOrSubtypes( + this, true /* include aux subtypes */)) { mImm.showInputMethodPicker(); return true; } @@ -1169,7 +1170,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen final IBinder token = getWindow().getWindow().getAttributes().token; if (mShouldSwitchToLastSubtype) { final InputMethodSubtype lastSubtype = mImm.getLastInputMethodSubtype(); - final boolean lastSubtypeBelongsToThisIme = SubtypeUtils.checkIfSubtypeBelongsToThisIme( + final boolean lastSubtypeBelongsToThisIme = ImfUtils.checkIfSubtypeBelongsToThisIme( this, lastSubtype); if ((includesOtherImes || lastSubtypeBelongsToThisIme) && mImm.switchToLastInputMethod(token)) { @@ -2299,6 +2300,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen getString(R.string.language_selection_title), getString(R.string.english_ime_settings), }; + final Context context = this; final DialogInterface.OnClickListener listener = new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface di, int position) { @@ -2306,7 +2308,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen switch (position) { case 0: Intent intent = CompatUtils.getInputLanguageSelectionIntent( - SubtypeUtils.getInputMethodId(getPackageName()), + ImfUtils.getInputMethodIdOfThisIme(context), Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED | Intent.FLAG_ACTIVITY_CLEAR_TOP); diff --git a/java/src/com/android/inputmethod/latin/SettingsValues.java b/java/src/com/android/inputmethod/latin/SettingsValues.java index b961a768d..539ac5963 100644 --- a/java/src/com/android/inputmethod/latin/SettingsValues.java +++ b/java/src/com/android/inputmethod/latin/SettingsValues.java @@ -306,9 +306,10 @@ public class SettingsValues { return false; } if (mIncludesOtherImesInLanguageSwitchList) { - return SubtypeUtils.hasMultipleEnabledIMEsOrSubtypes(/* include aux subtypes */false); + return ImfUtils.hasMultipleEnabledIMEsOrSubtypes( + context, /* include aux subtypes */false); } else { - return SubtypeUtils.hasMultipleEnabledSubtypesInThisIme( + return ImfUtils.hasMultipleEnabledSubtypesInThisIme( context, /* include aux subtypes */false); } } diff --git a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java index a2b8254a6..cf95a7e1a 100644 --- a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java +++ b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java @@ -28,9 +28,9 @@ import android.os.IBinder; import android.text.TextUtils; import android.util.Log; import android.view.inputmethod.InputMethodInfo; +import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodSubtype; -import com.android.inputmethod.compat.InputMethodManagerCompatWrapper; import com.android.inputmethod.keyboard.KeyboardSwitcher; import java.util.ArrayList; @@ -52,7 +52,7 @@ public class SubtypeSwitcher { private static final SubtypeSwitcher sInstance = new SubtypeSwitcher(); private /* final */ LatinIME mService; - private /* final */ InputMethodManagerCompatWrapper mImm; + private /* final */ InputMethodManager mImm; private /* final */ Resources mResources; private /* final */ ConnectivityManager mConnectivityManager; private final ArrayList mEnabledKeyboardSubtypesOfCurrentInputMethod = @@ -94,7 +94,7 @@ public class SubtypeSwitcher { private void initialize(LatinIME service) { mService = service; mResources = service.getResources(); - mImm = InputMethodManagerCompatWrapper.getInstance(); + mImm = ImfUtils.getInputMethodManager(service); mConnectivityManager = (ConnectivityManager) service.getSystemService( Context.CONNECTIVITY_SERVICE); mEnabledKeyboardSubtypesOfCurrentInputMethod.clear(); @@ -104,7 +104,7 @@ public class SubtypeSwitcher { mInputLocaleStr = null; mCurrentSubtype = mImm.getCurrentInputMethodSubtype(); mAllEnabledSubtypesOfCurrentInputMethod = null; - mNoLanguageSubtype = SubtypeUtils.findSubtypeByLocaleAndKeyboardLayoutSet( + mNoLanguageSubtype = ImfUtils.findSubtypeByLocaleAndKeyboardLayoutSet( service, SubtypeLocale.NO_LANGUAGE, AdditionalSubtype.QWERTY); final NetworkInfo info = mConnectivityManager.getActiveNetworkInfo(); @@ -277,7 +277,7 @@ public class SubtypeSwitcher { if (token == null) { return; } - final InputMethodManagerCompatWrapper imm = mImm; + final InputMethodManager imm = mImm; new AsyncTask() { @Override protected Void doInBackground(Void... params) { diff --git a/java/src/com/android/inputmethod/latin/SubtypeUtils.java b/java/src/com/android/inputmethod/latin/SubtypeUtils.java deleted file mode 100644 index 30be181de..000000000 --- a/java/src/com/android/inputmethod/latin/SubtypeUtils.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.inputmethod.latin; - -import android.content.Context; -import android.view.inputmethod.InputMethodInfo; -import android.view.inputmethod.InputMethodSubtype; - -import com.android.inputmethod.compat.InputMethodManagerCompatWrapper; - -import java.util.Collections; -import java.util.List; - -public class SubtypeUtils { - private SubtypeUtils() { - // This utility class is not publicly instantiable. - } - - // TODO: Cache my InputMethodInfo and/or InputMethodSubtype list. - public static boolean checkIfSubtypeBelongsToThisIme(Context context, InputMethodSubtype ims) { - final InputMethodManagerCompatWrapper imm = InputMethodManagerCompatWrapper.getInstance(); - if (imm == null) return false; - - final InputMethodInfo myImi = getInputMethodInfo(context.getPackageName()); - final List subtypes = imm.getEnabledInputMethodSubtypeList(myImi, true); - for (final InputMethodSubtype subtype : subtypes) { - if (subtype.equals(ims)) { - return true; - } - } - return false; - } - - public static boolean hasMultipleEnabledIMEsOrSubtypes( - final boolean shouldIncludeAuxiliarySubtypes) { - final InputMethodManagerCompatWrapper imm = InputMethodManagerCompatWrapper.getInstance(); - if (imm == null) return false; - - final List enabledImis = imm.getEnabledInputMethodList(); - return hasMultipleEnabledSubtypes(shouldIncludeAuxiliarySubtypes, enabledImis); - } - - public static boolean hasMultipleEnabledSubtypesInThisIme(Context context, - final boolean shouldIncludeAuxiliarySubtypes) { - final InputMethodInfo myImi = getInputMethodInfo(context.getPackageName()); - final List imiList = Collections.singletonList(myImi); - return hasMultipleEnabledSubtypes(shouldIncludeAuxiliarySubtypes, imiList); - } - - private static boolean hasMultipleEnabledSubtypes(final boolean shouldIncludeAuxiliarySubtypes, - List imiList) { - final InputMethodManagerCompatWrapper imm = InputMethodManagerCompatWrapper.getInstance(); - if (imm == null) return false; - - // Number of the filtered IMEs - int filteredImisCount = 0; - - for (InputMethodInfo imi : imiList) { - // We can return true immediately after we find two or more filtered IMEs. - if (filteredImisCount > 1) return true; - final List subtypes = - imm.getEnabledInputMethodSubtypeList(imi, true); - // IMEs that have no subtypes should be counted. - if (subtypes.isEmpty()) { - ++filteredImisCount; - continue; - } - - int auxCount = 0; - for (InputMethodSubtype subtype : subtypes) { - if (subtype.isAuxiliary()) { - ++auxCount; - } - } - final int nonAuxCount = subtypes.size() - auxCount; - - // IMEs that have one or more non-auxiliary subtypes should be counted. - // If shouldIncludeAuxiliarySubtypes is true, IMEs that have two or more auxiliary - // subtypes should be counted as well. - if (nonAuxCount > 0 || (shouldIncludeAuxiliarySubtypes && auxCount > 1)) { - ++filteredImisCount; - continue; - } - } - - if (filteredImisCount > 1) { - return true; - } - final List subtypes = imm.getEnabledInputMethodSubtypeList(null, true); - int keyboardCount = 0; - // imm.getEnabledInputMethodSubtypeList(null, true) will return the current IME's - // both explicitly and implicitly enabled input method subtype. - // (The current IME should be LatinIME.) - for (InputMethodSubtype subtype : subtypes) { - if (SubtypeSwitcher.KEYBOARD_MODE.equals(subtype.getMode())) { - ++keyboardCount; - } - } - return keyboardCount > 1; - } - - public static String getInputMethodId(String packageName) { - return getInputMethodInfo(packageName).getId(); - } - - public static InputMethodInfo getInputMethodInfo(String packageName) { - final InputMethodManagerCompatWrapper imm = InputMethodManagerCompatWrapper.getInstance(); - if (imm == null) { - throw new RuntimeException("Input method manager not found"); - } - - for (final InputMethodInfo imi : imm.getInputMethodList()) { - if (imi.getPackageName().equals(packageName)) - return imi; - } - throw new RuntimeException("Can not find input method id for " + packageName); - } - - public static InputMethodSubtype findSubtypeByLocaleAndKeyboardLayoutSet( - Context context, String localeString, String keyboardLayoutSetName) { - final InputMethodInfo imi = getInputMethodInfo(context.getPackageName()); - final int count = imi.getSubtypeCount(); - for (int i = 0; i < count; i++) { - final InputMethodSubtype subtype = imi.getSubtypeAt(i); - final String layoutName = SubtypeLocale.getKeyboardLayoutSetName(subtype); - if (localeString.equals(subtype.getLocale()) - && keyboardLayoutSetName.equals(layoutName)) { - return subtype; - } - } - throw new RuntimeException("Can't find subtype for locale " + localeString - + " and keyboard layout " + keyboardLayoutSetName); - } - - public static void setAdditionalInputMethodSubtypes(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); - } -} -- cgit v1.2.3-83-g751a