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

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

Merge "Set mCurrentUserId before UC.startUserInternal returns." into main

parents e43dda75 dd492b80
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -2107,6 +2107,15 @@ class UserController implements Handler.Callback {
                t.traceEnd();
            }

            if (foreground) {
                // Make sure the old user is no longer considering the display to be on.
                mInjector.reportGlobalUsageEvent(UsageEvents.Event.SCREEN_NON_INTERACTIVE);
                synchronized (mLock) {
                    mCurrentUserId = userId;
                    ActivityManager.invalidateGetCurrentUserIdCache();
                }
            }

            UserState finalUss = uss;
            boolean finalNeedStart = needStart;
            final Runnable continueStartUserInternal = () -> continueStartUserInternal(userInfo,
@@ -2132,12 +2141,8 @@ class UserController implements Handler.Callback {

        t.traceBegin("updateConfigurationAndProfileIds");
        if (foreground) {
            // Make sure the old user is no longer considering the display to be on.
            mInjector.reportGlobalUsageEvent(UsageEvents.Event.SCREEN_NON_INTERACTIVE);
            boolean userSwitchUiEnabled;
            synchronized (mLock) {
                mCurrentUserId = userId;
                ActivityManager.invalidateGetCurrentUserIdCache();
                userSwitchUiEnabled = mUserSwitchUiEnabled;
            }
            mInjector.updateUserConfiguration();