diff --git a/core/java/com/android/internal/inputmethod/InputMethodSubtypeSwitchingController.java b/core/java/com/android/internal/inputmethod/InputMethodSubtypeSwitchingController.java index e607a3ff9ad00..85cc841379cfb 100644 --- a/core/java/com/android/internal/inputmethod/InputMethodSubtypeSwitchingController.java +++ b/core/java/com/android/internal/inputmethod/InputMethodSubtypeSwitchingController.java @@ -175,7 +175,7 @@ public class InputMethodSubtypeSwitchingController { } private final TreeMap> mSortedImmis = - new TreeMap>( + new TreeMap<>( new Comparator() { @Override public int compare(InputMethodInfo imi1, InputMethodInfo imi2) { @@ -192,14 +192,9 @@ public class InputMethodSubtypeSwitchingController { } }); - public List getSortedInputMethodAndSubtypeList() { - return getSortedInputMethodAndSubtypeList(true, false, false); - } - public List getSortedInputMethodAndSubtypeList( - boolean showSubtypes, boolean includeAuxiliarySubtypes, boolean isScreenLocked) { - final ArrayList imList = - new ArrayList(); + boolean includeAuxiliarySubtypes, boolean isScreenLocked) { + final ArrayList imList = new ArrayList<>(); final HashMap> immis = mSettings.getExplicitlyOrImplicitlyEnabledInputMethodsAndSubtypeListLocked( mContext); @@ -219,12 +214,12 @@ public class InputMethodSubtypeSwitchingController { continue; } List explicitlyOrImplicitlyEnabledSubtypeList = immis.get(imi); - HashSet enabledSubtypeSet = new HashSet(); + HashSet enabledSubtypeSet = new HashSet<>(); for (InputMethodSubtype subtype : explicitlyOrImplicitlyEnabledSubtypeList) { enabledSubtypeSet.add(String.valueOf(subtype.hashCode())); } final CharSequence imeLabel = imi.loadLabel(mPm); - if (showSubtypes && enabledSubtypeSet.size() > 0) { + if (enabledSubtypeSet.size() > 0) { final int subtypeCount = imi.getSubtypeCount(); if (DEBUG) { Slog.v(TAG, "Add subtypes: " + subtypeCount + ", " + imi.getId()); @@ -532,7 +527,8 @@ public class InputMethodSubtypeSwitchingController { public void resetCircularListLocked(Context context) { mSubtypeList = new InputMethodAndSubtypeList(context, mSettings); mController = ControllerImpl.createFrom(mController, - mSubtypeList.getSortedInputMethodAndSubtypeList()); + mSubtypeList.getSortedInputMethodAndSubtypeList( + false /* includeAuxiliarySubtypes */, false /* isScreenLocked */)); } public ImeSubtypeListItem getNextInputMethodLocked(boolean onlyCurrentIme, InputMethodInfo imi, @@ -546,10 +542,10 @@ public class InputMethodSubtypeSwitchingController { return mController.getNextInputMethod(onlyCurrentIme, imi, subtype); } - public List getSortedInputMethodAndSubtypeListLocked(boolean showSubtypes, + public List getSortedInputMethodAndSubtypeListLocked( boolean includingAuxiliarySubtypes, boolean isScreenLocked) { return mSubtypeList.getSortedInputMethodAndSubtypeList( - showSubtypes, includingAuxiliarySubtypes, isScreenLocked); + includingAuxiliarySubtypes, isScreenLocked); } public void dump(final Printer pw) { diff --git a/services/core/java/com/android/server/InputMethodManagerService.java b/services/core/java/com/android/server/InputMethodManagerService.java index 0282a72784c8b..ef79cfe989886 100644 --- a/services/core/java/com/android/server/InputMethodManagerService.java +++ b/services/core/java/com/android/server/InputMethodManagerService.java @@ -3027,7 +3027,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub final List imList = mSwitchingController.getSortedInputMethodAndSubtypeListLocked( - true /* showSubtypes */, showAuxSubtypes, isScreenLocked); + showAuxSubtypes, isScreenLocked); if (lastInputMethodSubtypeId == NOT_A_SUBTYPE_ID) { final InputMethodSubtype currentSubtype = getCurrentInputMethodSubtypeLocked();