Loading core/java/com/android/internal/inputmethod/InputMethodUtils.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -985,7 +985,7 @@ public class InputMethodUtils { } } } } public List<InputMethodInfo> getEnabledInputMethodListLocked() { public ArrayList<InputMethodInfo> getEnabledInputMethodListLocked() { return createEnabledInputMethodListLocked( return createEnabledInputMethodListLocked( getEnabledInputMethodsAndSubtypeListLocked()); getEnabledInputMethodsAndSubtypeListLocked()); } } Loading Loading @@ -1092,7 +1092,7 @@ public class InputMethodUtils { return isRemoved; return isRemoved; } } private List<InputMethodInfo> createEnabledInputMethodListLocked( private ArrayList<InputMethodInfo> createEnabledInputMethodListLocked( List<Pair<String, ArrayList<String>>> imsList) { List<Pair<String, ArrayList<String>>> imsList) { final ArrayList<InputMethodInfo> res = new ArrayList<>(); final ArrayList<InputMethodInfo> res = new ArrayList<>(); for (Pair<String, ArrayList<String>> ims: imsList) { for (Pair<String, ArrayList<String>> ims: imsList) { Loading services/core/java/com/android/server/InputMethodManagerService.java +9 −26 Original line number Original line Diff line number Diff line Loading @@ -940,36 +940,19 @@ public class InputMethodManagerService extends IInputMethodManager.Stub private void resetDefaultImeLocked(Context context) { private void resetDefaultImeLocked(Context context) { // Do not reset the default (current) IME when it is a 3rd-party IME // Do not reset the default (current) IME when it is a 3rd-party IME if (mCurMethodId != null if (mCurMethodId != null && !InputMethodUtils.isSystemIme(mMethodMap.get(mCurMethodId))) { && !InputMethodUtils.isSystemIme(mMethodMap.get(mCurMethodId))) { return; return; } } final List<InputMethodInfo> suitableImes = InputMethodUtils.getDefaultEnabledImes( InputMethodInfo defIm = null; context, mSystemReady, mSettings.getEnabledInputMethodListLocked()); for (InputMethodInfo imi : mMethodList) { if (suitableImes.isEmpty()) { if (defIm == null && mSystemReady) { final Locale systemLocale = context.getResources().getConfiguration().locale; if (InputMethodUtils.isSystemImeThatHasSubtypeOf(imi, context, true /* checkDefaultAttribute */, systemLocale, false /* checkCountry */, InputMethodUtils.SUBTYPE_MODE_ANY)) { defIm = imi; Slog.i(TAG, "Selected default: " + imi.getId()); } } } if (defIm == null && mMethodList.size() > 0) { defIm = InputMethodUtils.getMostApplicableDefaultIME( mSettings.getEnabledInputMethodListLocked()); if (defIm != null) { Slog.i(TAG, "Default found, using " + defIm.getId()); } else { Slog.i(TAG, "No default found"); Slog.i(TAG, "No default found"); return; } } } final InputMethodInfo defIm = suitableImes.get(0); if (defIm != null) { Slog.i(TAG, "Default found, using " + defIm.getId()); setSelectedInputMethodAndSubtypeLocked(defIm, NOT_A_SUBTYPE_ID, false); setSelectedInputMethodAndSubtypeLocked(defIm, NOT_A_SUBTYPE_ID, false); } } } private void resetAllInternalStateLocked(final boolean updateOnlyWhenLocaleChanged, private void resetAllInternalStateLocked(final boolean updateOnlyWhenLocaleChanged, final boolean resetDefaultEnabledIme) { final boolean resetDefaultEnabledIme) { Loading Loading
core/java/com/android/internal/inputmethod/InputMethodUtils.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -985,7 +985,7 @@ public class InputMethodUtils { } } } } public List<InputMethodInfo> getEnabledInputMethodListLocked() { public ArrayList<InputMethodInfo> getEnabledInputMethodListLocked() { return createEnabledInputMethodListLocked( return createEnabledInputMethodListLocked( getEnabledInputMethodsAndSubtypeListLocked()); getEnabledInputMethodsAndSubtypeListLocked()); } } Loading Loading @@ -1092,7 +1092,7 @@ public class InputMethodUtils { return isRemoved; return isRemoved; } } private List<InputMethodInfo> createEnabledInputMethodListLocked( private ArrayList<InputMethodInfo> createEnabledInputMethodListLocked( List<Pair<String, ArrayList<String>>> imsList) { List<Pair<String, ArrayList<String>>> imsList) { final ArrayList<InputMethodInfo> res = new ArrayList<>(); final ArrayList<InputMethodInfo> res = new ArrayList<>(); for (Pair<String, ArrayList<String>> ims: imsList) { for (Pair<String, ArrayList<String>> ims: imsList) { Loading
services/core/java/com/android/server/InputMethodManagerService.java +9 −26 Original line number Original line Diff line number Diff line Loading @@ -940,36 +940,19 @@ public class InputMethodManagerService extends IInputMethodManager.Stub private void resetDefaultImeLocked(Context context) { private void resetDefaultImeLocked(Context context) { // Do not reset the default (current) IME when it is a 3rd-party IME // Do not reset the default (current) IME when it is a 3rd-party IME if (mCurMethodId != null if (mCurMethodId != null && !InputMethodUtils.isSystemIme(mMethodMap.get(mCurMethodId))) { && !InputMethodUtils.isSystemIme(mMethodMap.get(mCurMethodId))) { return; return; } } final List<InputMethodInfo> suitableImes = InputMethodUtils.getDefaultEnabledImes( InputMethodInfo defIm = null; context, mSystemReady, mSettings.getEnabledInputMethodListLocked()); for (InputMethodInfo imi : mMethodList) { if (suitableImes.isEmpty()) { if (defIm == null && mSystemReady) { final Locale systemLocale = context.getResources().getConfiguration().locale; if (InputMethodUtils.isSystemImeThatHasSubtypeOf(imi, context, true /* checkDefaultAttribute */, systemLocale, false /* checkCountry */, InputMethodUtils.SUBTYPE_MODE_ANY)) { defIm = imi; Slog.i(TAG, "Selected default: " + imi.getId()); } } } if (defIm == null && mMethodList.size() > 0) { defIm = InputMethodUtils.getMostApplicableDefaultIME( mSettings.getEnabledInputMethodListLocked()); if (defIm != null) { Slog.i(TAG, "Default found, using " + defIm.getId()); } else { Slog.i(TAG, "No default found"); Slog.i(TAG, "No default found"); return; } } } final InputMethodInfo defIm = suitableImes.get(0); if (defIm != null) { Slog.i(TAG, "Default found, using " + defIm.getId()); setSelectedInputMethodAndSubtypeLocked(defIm, NOT_A_SUBTYPE_ID, false); setSelectedInputMethodAndSubtypeLocked(defIm, NOT_A_SUBTYPE_ID, false); } } } private void resetAllInternalStateLocked(final boolean updateOnlyWhenLocaleChanged, private void resetAllInternalStateLocked(final boolean updateOnlyWhenLocaleChanged, final boolean resetDefaultEnabledIme) { final boolean resetDefaultEnabledIme) { Loading