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

Commit 62995efe authored by Alex Chau's avatar Alex Chau
Browse files

Check if UserState is null in stopGuestOrEphemeralUserIfBackground

- UserState may be removed from mStartedUsers if it has already been stopped

Bug: 72133858
Test: Manually create secondary user, and exit the user in SetupWizard
Change-Id: I92783f89a9d4de9a7eca81e688b4e115c2f5535a
parent 5123afc0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -796,7 +796,7 @@ class UserController implements Handler.Callback {
    private void stopGuestOrEphemeralUserIfBackground(int oldUserId) {
        if (DEBUG_MU) Slog.i(TAG, "Stop guest or ephemeral user if background: " + oldUserId);
        UserState oldUss = mStartedUsers.get(oldUserId);
        if (oldUserId == UserHandle.USER_SYSTEM || oldUserId == mCurrentUserId
        if (oldUserId == UserHandle.USER_SYSTEM || oldUserId == mCurrentUserId || oldUss == null
                || oldUss.state == UserState.STATE_STOPPING
                || oldUss.state == UserState.STATE_SHUTDOWN) {
            return;