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

Commit 895a474f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Use String[] for IMMS#mNonPreemptibleInputMethods"

parents fe23398f b1793891
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -175,6 +175,7 @@ import com.android.internal.inputmethod.UnbindReason;
import com.android.internal.messages.nano.SystemMessageProto.SystemMessage;
import com.android.internal.notification.SystemNotificationChannels;
import com.android.internal.os.TransferPipe;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.ConcurrentUtils;
import com.android.internal.util.DumpUtils;
import com.android.internal.view.IInputMethodManager;
@@ -193,8 +194,6 @@ import com.android.server.statusbar.StatusBarManagerService;
import com.android.server.utils.PriorityDump;
import com.android.server.wm.WindowManagerInternal;

import com.google.android.collect.Sets;

import java.io.FileDescriptor;
import java.io.IOException;
import java.io.PrintWriter;
@@ -209,7 +208,6 @@ import java.util.List;
import java.util.Locale;
import java.util.Objects;
import java.util.OptionalInt;
import java.util.Set;
import java.util.WeakHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.Future;
@@ -281,7 +279,7 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
     * {@link #mPreventImeStartupUnlessTextEditor}.
     */
    @NonNull
    private final Set<String> mNonPreemptibleInputMethods;
    private final String[] mNonPreemptibleInputMethods;

    @UserIdInt
    private int mLastSwitchUserId;
@@ -1769,8 +1767,8 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
        mAutofillController = new AutofillSuggestionsController(this);
        mPreventImeStartupUnlessTextEditor = mRes.getBoolean(
                com.android.internal.R.bool.config_preventImeStartupUnlessTextEditor);
        mNonPreemptibleInputMethods = Sets.newHashSet(mRes.getStringArray(
                com.android.internal.R.array.config_nonPreemptibleInputMethods));
        mNonPreemptibleInputMethods = mRes.getStringArray(
                com.android.internal.R.array.config_nonPreemptibleInputMethods);
        mHwController = new HandwritingModeController(thread.getLooper(),
                new InkWindowInitializer());
        registerDeviceListenerAndCheckStylusSupport();
@@ -2611,7 +2609,7 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
    private boolean isNonPreemptibleImeLocked(@NonNull  String selectedMethodId) {
        final InputMethodInfo imi = mMethodMap.get(selectedMethodId);
        if (imi != null) {
            return mNonPreemptibleInputMethods.contains(imi.getPackageName());
            return ArrayUtils.contains(mNonPreemptibleInputMethods, imi.getPackageName());
        }
        return false;
    }