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

Commit f75b3d64 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Do not trigger IME user switching in experimental multi-user mode" into main

parents f3986f11 24e83fb5
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1127,6 +1127,11 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
        public void onUserSwitching(@Nullable TargetUser from, @NonNull TargetUser to) {
            // Called on ActivityManager thread.
            synchronized (ImfLock.class) {
                if (mService.mExperimentalConcurrentMultiUserModeEnabled) {
                    // In concurrent multi-user mode, we in general do not rely on the concept of
                    // current user.
                    return;
                }
                mService.scheduleSwitchUserTaskLocked(to.getUserIdentifier(),
                        /* clientToBeReset= */ null);
            }
@@ -3553,7 +3558,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
                final long ident = Binder.clearCallingIdentity();
                try {
                    // Verify if IMMS is in the process of switching user.
                    if (mUserSwitchHandlerTask != null) {
                    if (!mExperimentalConcurrentMultiUserModeEnabled
                            && mUserSwitchHandlerTask != null) {
                        // There is already an on-going pending user switch task.
                        final int nextUserId = mUserSwitchHandlerTask.mToUserId;
                        if (userId == nextUserId) {
@@ -3607,7 +3613,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
                    }

                    // Verify if caller is a background user.
                    if (userId != mCurrentUserId) {
                    if (!mExperimentalConcurrentMultiUserModeEnabled && userId != mCurrentUserId) {
                        if (ArrayUtils.contains(
                                mUserManagerInternal.getProfileIds(mCurrentUserId, false),
                                userId)) {