Loading services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +12 −7 Original line number Diff line number Diff line Loading @@ -4073,14 +4073,18 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub final List<InputMethodInfo> enabled = mSettings.getEnabledInputMethodListLocked(); if (enabled != null) { final int enabledCount = enabled.size(); final String locale = mCurrentSubtype == null ? mRes.getConfiguration().locale.toString() : mCurrentSubtype.getLocale(); final String locale; if (mCurrentSubtype != null && !TextUtils.isEmpty(mCurrentSubtype.getLocale())) { locale = mCurrentSubtype.getLocale(); } else { locale = mRes.getConfiguration().locale.toString(); } for (int i = 0; i < enabledCount; ++i) { final InputMethodInfo imi = enabled.get(i); if (imi.getSubtypeCount() > 0 && imi.isSystem()) { InputMethodSubtype keyboardSubtype = SubtypeUtils.findLastResortApplicableSubtypeLocked(mRes, SubtypeUtils.findLastResortApplicableSubtypeLocked( SubtypeUtils.getSubtypes(imi), SubtypeUtils.SUBTYPE_MODE_KEYBOARD, locale, true); if (keyboardSubtype != null) { Loading Loading @@ -5430,12 +5434,13 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub if (explicitlyOrImplicitlyEnabledSubtypes.size() == 1) { mCurrentSubtype = explicitlyOrImplicitlyEnabledSubtypes.get(0); } else if (explicitlyOrImplicitlyEnabledSubtypes.size() > 1) { final String locale = mRes.getConfiguration().locale.toString(); mCurrentSubtype = SubtypeUtils.findLastResortApplicableSubtypeLocked( mRes, explicitlyOrImplicitlyEnabledSubtypes, SubtypeUtils.SUBTYPE_MODE_KEYBOARD, null, true); explicitlyOrImplicitlyEnabledSubtypes, SubtypeUtils.SUBTYPE_MODE_KEYBOARD, locale, true); if (mCurrentSubtype == null) { mCurrentSubtype = SubtypeUtils.findLastResortApplicableSubtypeLocked( mRes, explicitlyOrImplicitlyEnabledSubtypes, null, null, true); explicitlyOrImplicitlyEnabledSubtypes, null, locale, true); } } } else { Loading services/core/java/com/android/server/inputmethod/InputMethodUtils.java +5 −4 Original line number Diff line number Diff line Loading @@ -847,14 +847,15 @@ final class InputMethodUtils { if (explicitlyOrImplicitlyEnabledSubtypes.size() == 1) { return explicitlyOrImplicitlyEnabledSubtypes.get(0); } final String locale = mRes.getConfiguration().locale.toString(); final InputMethodSubtype subtype = SubtypeUtils.findLastResortApplicableSubtypeLocked( mRes, explicitlyOrImplicitlyEnabledSubtypes, SubtypeUtils.SUBTYPE_MODE_KEYBOARD, null, true); explicitlyOrImplicitlyEnabledSubtypes, SubtypeUtils.SUBTYPE_MODE_KEYBOARD, locale, true); if (subtype != null) { return subtype; } return SubtypeUtils.findLastResortApplicableSubtypeLocked(mRes, explicitlyOrImplicitlyEnabledSubtypes, null, null, true); return SubtypeUtils.findLastResortApplicableSubtypeLocked( explicitlyOrImplicitlyEnabledSubtypes, null, locale, true); } boolean setAdditionalInputMethodSubtypes(@NonNull String imeId, Loading services/core/java/com/android/server/inputmethod/SubtypeUtils.java +2 −5 Original line number Diff line number Diff line Loading @@ -220,7 +220,7 @@ final class SubtypeUtils { if (applicableSubtypes.isEmpty()) { InputMethodSubtype lastResortKeyboardSubtype = findLastResortApplicableSubtypeLocked( res, subtypes, SUBTYPE_MODE_KEYBOARD, systemLocale, true); subtypes, SUBTYPE_MODE_KEYBOARD, systemLocale, true); if (lastResortKeyboardSubtype != null) { applicableSubtypes.add(lastResortKeyboardSubtype); } Loading Loading @@ -249,14 +249,11 @@ final class SubtypeUtils { * @return the most applicable subtypeId */ static InputMethodSubtype findLastResortApplicableSubtypeLocked( Resources res, List<InputMethodSubtype> subtypes, String mode, String locale, List<InputMethodSubtype> subtypes, String mode, @NonNull String locale, boolean canIgnoreLocaleAsLastResort) { if (subtypes == null || subtypes.isEmpty()) { return null; } if (TextUtils.isEmpty(locale)) { locale = res.getConfiguration().locale.toString(); } final String language = LocaleUtils.getLanguageFromLocaleString(locale); boolean partialMatchFound = false; InputMethodSubtype applicableSubtype = null; Loading Loading
services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +12 −7 Original line number Diff line number Diff line Loading @@ -4073,14 +4073,18 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub final List<InputMethodInfo> enabled = mSettings.getEnabledInputMethodListLocked(); if (enabled != null) { final int enabledCount = enabled.size(); final String locale = mCurrentSubtype == null ? mRes.getConfiguration().locale.toString() : mCurrentSubtype.getLocale(); final String locale; if (mCurrentSubtype != null && !TextUtils.isEmpty(mCurrentSubtype.getLocale())) { locale = mCurrentSubtype.getLocale(); } else { locale = mRes.getConfiguration().locale.toString(); } for (int i = 0; i < enabledCount; ++i) { final InputMethodInfo imi = enabled.get(i); if (imi.getSubtypeCount() > 0 && imi.isSystem()) { InputMethodSubtype keyboardSubtype = SubtypeUtils.findLastResortApplicableSubtypeLocked(mRes, SubtypeUtils.findLastResortApplicableSubtypeLocked( SubtypeUtils.getSubtypes(imi), SubtypeUtils.SUBTYPE_MODE_KEYBOARD, locale, true); if (keyboardSubtype != null) { Loading Loading @@ -5430,12 +5434,13 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub if (explicitlyOrImplicitlyEnabledSubtypes.size() == 1) { mCurrentSubtype = explicitlyOrImplicitlyEnabledSubtypes.get(0); } else if (explicitlyOrImplicitlyEnabledSubtypes.size() > 1) { final String locale = mRes.getConfiguration().locale.toString(); mCurrentSubtype = SubtypeUtils.findLastResortApplicableSubtypeLocked( mRes, explicitlyOrImplicitlyEnabledSubtypes, SubtypeUtils.SUBTYPE_MODE_KEYBOARD, null, true); explicitlyOrImplicitlyEnabledSubtypes, SubtypeUtils.SUBTYPE_MODE_KEYBOARD, locale, true); if (mCurrentSubtype == null) { mCurrentSubtype = SubtypeUtils.findLastResortApplicableSubtypeLocked( mRes, explicitlyOrImplicitlyEnabledSubtypes, null, null, true); explicitlyOrImplicitlyEnabledSubtypes, null, locale, true); } } } else { Loading
services/core/java/com/android/server/inputmethod/InputMethodUtils.java +5 −4 Original line number Diff line number Diff line Loading @@ -847,14 +847,15 @@ final class InputMethodUtils { if (explicitlyOrImplicitlyEnabledSubtypes.size() == 1) { return explicitlyOrImplicitlyEnabledSubtypes.get(0); } final String locale = mRes.getConfiguration().locale.toString(); final InputMethodSubtype subtype = SubtypeUtils.findLastResortApplicableSubtypeLocked( mRes, explicitlyOrImplicitlyEnabledSubtypes, SubtypeUtils.SUBTYPE_MODE_KEYBOARD, null, true); explicitlyOrImplicitlyEnabledSubtypes, SubtypeUtils.SUBTYPE_MODE_KEYBOARD, locale, true); if (subtype != null) { return subtype; } return SubtypeUtils.findLastResortApplicableSubtypeLocked(mRes, explicitlyOrImplicitlyEnabledSubtypes, null, null, true); return SubtypeUtils.findLastResortApplicableSubtypeLocked( explicitlyOrImplicitlyEnabledSubtypes, null, locale, true); } boolean setAdditionalInputMethodSubtypes(@NonNull String imeId, Loading
services/core/java/com/android/server/inputmethod/SubtypeUtils.java +2 −5 Original line number Diff line number Diff line Loading @@ -220,7 +220,7 @@ final class SubtypeUtils { if (applicableSubtypes.isEmpty()) { InputMethodSubtype lastResortKeyboardSubtype = findLastResortApplicableSubtypeLocked( res, subtypes, SUBTYPE_MODE_KEYBOARD, systemLocale, true); subtypes, SUBTYPE_MODE_KEYBOARD, systemLocale, true); if (lastResortKeyboardSubtype != null) { applicableSubtypes.add(lastResortKeyboardSubtype); } Loading Loading @@ -249,14 +249,11 @@ final class SubtypeUtils { * @return the most applicable subtypeId */ static InputMethodSubtype findLastResortApplicableSubtypeLocked( Resources res, List<InputMethodSubtype> subtypes, String mode, String locale, List<InputMethodSubtype> subtypes, String mode, @NonNull String locale, boolean canIgnoreLocaleAsLastResort) { if (subtypes == null || subtypes.isEmpty()) { return null; } if (TextUtils.isEmpty(locale)) { locale = res.getConfiguration().locale.toString(); } final String language = LocaleUtils.getLanguageFromLocaleString(locale); boolean partialMatchFound = false; InputMethodSubtype applicableSubtype = null; Loading