Loading java/src/com/android/inputmethod/latin/ImfUtils.java +7 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,13 @@ public class ImfUtils { return false; } public static InputMethodSubtype getCurrentInputMethodSubtype(Context context, InputMethodSubtype defaultSubtype) { final InputMethodManager imm = getInputMethodManager(context); final InputMethodSubtype currentSubtype = imm.getCurrentInputMethodSubtype(); return (currentSubtype != null) ? currentSubtype : defaultSubtype; } public static boolean hasMultipleEnabledIMEsOrSubtypes(Context context, final boolean shouldIncludeAuxiliarySubtypes) { final InputMethodManager imm = getInputMethodManager(context); Loading java/src/com/android/inputmethod/latin/SubtypeSwitcher.java +3 −3 Original line number Diff line number Diff line Loading @@ -98,9 +98,9 @@ public class SubtypeSwitcher { mConnectivityManager = (ConnectivityManager) service.getSystemService( Context.CONNECTIVITY_SERVICE); mCurrentSystemLocale = mResources.getConfiguration().locale; mCurrentSubtype = mImm.getCurrentInputMethodSubtype(); mNoLanguageSubtype = ImfUtils.findSubtypeByLocaleAndKeyboardLayoutSet( service, SubtypeLocale.NO_LANGUAGE, SubtypeLocale.QWERTY); mCurrentSubtype = ImfUtils.getCurrentInputMethodSubtype(service, mNoLanguageSubtype); if (mNoLanguageSubtype == null) { throw new RuntimeException("Can't find no lanugage with QWERTY subtype"); } Loading @@ -113,7 +113,7 @@ public class SubtypeSwitcher { // Only configuration changed event is allowed to call this because this is heavy. private void updateAllParameters() { mCurrentSystemLocale = mResources.getConfiguration().locale; updateSubtype(mImm.getCurrentInputMethodSubtype()); updateSubtype(ImfUtils.getCurrentInputMethodSubtype(mService, mNoLanguageSubtype)); updateParametersOnStartInputView(); } Loading Loading @@ -142,7 +142,7 @@ public class SubtypeSwitcher { + currentSubtype.getLocale() + "/" + currentSubtype.getExtraValue()); Log.w(TAG, "Last subtype was disabled. Update to the current one."); } updateSubtype(mImm.getCurrentInputMethodSubtype()); updateSubtype(ImfUtils.getCurrentInputMethodSubtype(mService, mNoLanguageSubtype)); } } Loading Loading
java/src/com/android/inputmethod/latin/ImfUtils.java +7 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,13 @@ public class ImfUtils { return false; } public static InputMethodSubtype getCurrentInputMethodSubtype(Context context, InputMethodSubtype defaultSubtype) { final InputMethodManager imm = getInputMethodManager(context); final InputMethodSubtype currentSubtype = imm.getCurrentInputMethodSubtype(); return (currentSubtype != null) ? currentSubtype : defaultSubtype; } public static boolean hasMultipleEnabledIMEsOrSubtypes(Context context, final boolean shouldIncludeAuxiliarySubtypes) { final InputMethodManager imm = getInputMethodManager(context); Loading
java/src/com/android/inputmethod/latin/SubtypeSwitcher.java +3 −3 Original line number Diff line number Diff line Loading @@ -98,9 +98,9 @@ public class SubtypeSwitcher { mConnectivityManager = (ConnectivityManager) service.getSystemService( Context.CONNECTIVITY_SERVICE); mCurrentSystemLocale = mResources.getConfiguration().locale; mCurrentSubtype = mImm.getCurrentInputMethodSubtype(); mNoLanguageSubtype = ImfUtils.findSubtypeByLocaleAndKeyboardLayoutSet( service, SubtypeLocale.NO_LANGUAGE, SubtypeLocale.QWERTY); mCurrentSubtype = ImfUtils.getCurrentInputMethodSubtype(service, mNoLanguageSubtype); if (mNoLanguageSubtype == null) { throw new RuntimeException("Can't find no lanugage with QWERTY subtype"); } Loading @@ -113,7 +113,7 @@ public class SubtypeSwitcher { // Only configuration changed event is allowed to call this because this is heavy. private void updateAllParameters() { mCurrentSystemLocale = mResources.getConfiguration().locale; updateSubtype(mImm.getCurrentInputMethodSubtype()); updateSubtype(ImfUtils.getCurrentInputMethodSubtype(mService, mNoLanguageSubtype)); updateParametersOnStartInputView(); } Loading Loading @@ -142,7 +142,7 @@ public class SubtypeSwitcher { + currentSubtype.getLocale() + "/" + currentSubtype.getExtraValue()); Log.w(TAG, "Last subtype was disabled. Update to the current one."); } updateSubtype(mImm.getCurrentInputMethodSubtype()); updateSubtype(ImfUtils.getCurrentInputMethodSubtype(mService, mNoLanguageSubtype)); } } Loading