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

Commit 58e26a57 authored by Nikhil Kumar's avatar Nikhil Kumar Committed by Android (Google) Code Review
Browse files

Merge "Refactored switchUSer to handle user switch back to the current user" into udc-qpr-dev

parents 9f556ea7 1e3d4f48
Loading
Loading
Loading
Loading
+18 −16
Original line number Diff line number Diff line
@@ -1928,7 +1928,9 @@ class UserController implements Handler.Callback {
        EventLog.writeEvent(EventLogTags.UC_SWITCH_USER, targetUserId);
        int currentUserId = getCurrentUserId();
        UserInfo targetUserInfo = getUserInfo(targetUserId);
        if (targetUserId == currentUserId) {
        boolean userSwitchUiEnabled;
        synchronized (mLock) {
            if (targetUserId == currentUserId && mTargetUserId == UserHandle.USER_NULL) {
                Slogf.i(TAG, "user #" + targetUserId + " is already the current user");
                return true;
            }
@@ -1941,11 +1943,11 @@ class UserController implements Handler.Callback {
                return false;
            }
            if (FactoryResetter.isFactoryResetting()) {
            Slogf.w(TAG, "Cannot switch to User #" + targetUserId + ": factory reset in progress");
                Slogf.w(TAG, "Cannot switch to User #" + targetUserId
                        + ": factory reset in progress");
                return false;
            }
        boolean userSwitchUiEnabled;
        synchronized (mLock) {

            if (!mInitialized) {
                Slogf.e(TAG, "Cannot switch to User #" + targetUserId
                        + ": UserController not ready yet");