Fix set additional subtypes.
Bug: 5102787
Change-Id: Ic38db8c33b6496a083e8158cd79fb54c21187b04
diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java
index 38bcebc..ba2438b 100644
--- a/services/java/com/android/server/InputMethodManagerService.java
+++ b/services/java/com/android/server/InputMethodManagerService.java
@@ -3065,17 +3065,11 @@
public void addInputMethodSubtypes(
InputMethodInfo imi, InputMethodSubtype[] additionalSubtypes) {
synchronized (mMethodMap) {
- final HashSet<InputMethodSubtype> existingSubtypes =
- new HashSet<InputMethodSubtype>();
- for (int i = 0; i < imi.getSubtypeCount(); ++i) {
- existingSubtypes.add(imi.getSubtypeAt(i));
- }
-
final ArrayList<InputMethodSubtype> subtypes = new ArrayList<InputMethodSubtype>();
final int N = additionalSubtypes.length;
for (int i = 0; i < N; ++i) {
final InputMethodSubtype subtype = additionalSubtypes[i];
- if (!subtypes.contains(subtype) && !existingSubtypes.contains(subtype)) {
+ if (!subtypes.contains(subtype)) {
subtypes.add(subtype);
}
}