Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed2b24ec authored by satok's avatar satok
Browse files

Fix set additional subtypes.

Bug: 5102787
Change-Id: Ic38db8c33b6496a083e8158cd79fb54c21187b04
parent 8da2a004
Loading
Loading
Loading
Loading
+1 −7
Original line number Original line Diff line number Diff line
@@ -3065,17 +3065,11 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
        public void addInputMethodSubtypes(
        public void addInputMethodSubtypes(
                InputMethodInfo imi, InputMethodSubtype[] additionalSubtypes) {
                InputMethodInfo imi, InputMethodSubtype[] additionalSubtypes) {
            synchronized (mMethodMap) {
            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 ArrayList<InputMethodSubtype> subtypes = new ArrayList<InputMethodSubtype>();
                final int N = additionalSubtypes.length;
                final int N = additionalSubtypes.length;
                for (int i = 0; i < N; ++i) {
                for (int i = 0; i < N; ++i) {
                    final InputMethodSubtype subtype = additionalSubtypes[i];
                    final InputMethodSubtype subtype = additionalSubtypes[i];
                    if (!subtypes.contains(subtype) && !existingSubtypes.contains(subtype)) {
                    if (!subtypes.contains(subtype)) {
                        subtypes.add(subtype);
                        subtypes.add(subtype);
                    }
                    }
                }
                }