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

Commit ce43b1b2 authored by Fyodor Kupolov's avatar Fyodor Kupolov
Browse files

Removed isUserStoppingOrShuttingDownLocked

It was causing issues when user state was removed (or user was never
started).
Replaced it with isUserRunningLocked which returns false if user state
is null/shutdown or stopping.

Test: manual - create/switch to/from guest user
Bug: 64319208
Change-Id: I88dae7111692e760b10cd7db13d5cd17dae2f2cb
parent df421a8b
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -2012,7 +2012,7 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
    public boolean okToShowLocked() {
    public boolean okToShowLocked() {
        return (info.flags & FLAG_SHOW_FOR_ALL_USERS) != 0
        return (info.flags & FLAG_SHOW_FOR_ALL_USERS) != 0
                || (mStackSupervisor.isCurrentProfileLocked(userId)
                || (mStackSupervisor.isCurrentProfileLocked(userId)
                && !service.mUserController.isUserStoppingOrShuttingDownLocked(userId));
                && service.mUserController.isUserRunningLocked(userId, 0 /* flags */));
    }
    }


    /**
    /**
+0 −9
Original line number Original line Diff line number Diff line
@@ -1447,15 +1447,6 @@ final class UserController {
        return mStartedUserArray;
        return mStartedUserArray;
    }
    }


    boolean isUserStoppingOrShuttingDownLocked(int userId) {
        UserState state = getStartedUserStateLocked(userId);
        if (state == null) {
            return false;
        }
        return state.state == UserState.STATE_STOPPING
                || state.state == UserState.STATE_SHUTDOWN;
    }

    boolean isUserRunningLocked(int userId, int flags) {
    boolean isUserRunningLocked(int userId, int flags) {
        UserState state = getStartedUserStateLocked(userId);
        UserState state = getStartedUserStateLocked(userId);
        if (state == null) {
        if (state == null) {