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

Commit 478f7535 authored by Vaibhav Devmurari's avatar Vaibhav Devmurari Committed by Android (Google) Code Review
Browse files

Merge "Use SystemService lifecycle to keep track of current user" into main

parents 24e8e2c5 ef670528
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -3038,6 +3038,14 @@ public class InputManagerService extends IInputManager.Stub
        mNative.resetLockedModifierState();
    }

    private void onUserSwitching(@NonNull SystemService.TargetUser from,
            @NonNull SystemService.TargetUser to) {
        if (DEBUG) {
            Slog.d(TAG, "onUserSwitching from=" + from + " to=" + to);
        }
        mHandler.obtainMessage(MSG_CURRENT_USER_CHANGED, to.getUserIdentifier()).sendToTarget();
    }

    private void handleCurrentUserChanged(@UserIdInt int userId) {
        mCurrentUserId = userId;
        mKeyGestureController.setCurrentUserId(userId);
@@ -3424,6 +3432,11 @@ public class InputManagerService extends IInputManager.Stub
            }
        }

        @Override
        public void onUserSwitching(@Nullable TargetUser from, @NonNull TargetUser to) {
            mService.onUserSwitching(from, to);
        }

        public InputManagerService getService() {
            return mService;
        }
+4 −1
Original line number Diff line number Diff line
@@ -85,6 +85,7 @@ import static android.view.contentprotection.flags.Flags.createAccessibilityOver

import static com.android.hardware.input.Flags.enableNew25q2Keycodes;
import static com.android.hardware.input.Flags.enableTalkbackAndMagnifierKeyGestures;
import static com.android.hardware.input.Flags.inputManagerLifecycleSupport;
import static com.android.hardware.input.Flags.keyboardA11yShortcutControl;
import static com.android.hardware.input.Flags.modifierShortcutDump;
import static com.android.hardware.input.Flags.useKeyGestureEventHandler;
@@ -7106,8 +7107,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        if (modifierShortcutManagerMultiuser()) {
            mModifierShortcutManager.setCurrentUser(UserHandle.of(newUserId));
        }
        if (!inputManagerLifecycleSupport()) {
            mInputManagerInternal.setCurrentUser(newUserId);
        }
    }

    @Override
    public void setSwitchingUser(boolean switching) {