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

Commit 6a2dd9b9 authored by Felipe Leme's avatar Felipe Leme Committed by Android (Google) Code Review
Browse files

Merge "Minor changes on AccessibilityManagerService for visible bg users:" into udc-dev

parents 77364c59 9769884a
Loading
Loading
Loading
Loading
+15 −7
Original line number Original line Diff line number Diff line
@@ -1443,17 +1443,19 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
            return;
            return;
        }
        }
        if (!mVisibleBgUserIds.get(userId)) {
        if (!mVisibleBgUserIds.get(userId)) {
            Slogf.wtf(LOG_TAG, "Cannot change current user to %d as it's not visible "
            Slogf.wtf(LOG_TAG, "changeCurrentUserForTestAutomationIfNeededLocked(): cannot change "
                    + "(mVisibleUsers=%s)", userId, mVisibleBgUserIds);
                    + "current user to %d as it's not visible (mVisibleUsers=%s)",
                    userId, mVisibleBgUserIds);
            return;
            return;
        }
        }
        if (mCurrentUserId == userId) {
        if (mCurrentUserId == userId) {
            Slogf.w(LOG_TAG, "NOT changing current user for test automation purposes as it is "
            Slogf.d(LOG_TAG, "changeCurrentUserForTestAutomationIfNeededLocked(): NOT changing "
                    + "already %d", mCurrentUserId);
                    + "current user for test automation purposes as it is already %d",
                    mCurrentUserId);
            return;
            return;
        }
        }
        Slogf.i(LOG_TAG, "Changing current user from %d to %d for test automation purposes",
        Slogf.i(LOG_TAG, "changeCurrentUserForTestAutomationIfNeededLocked(): changing current user"
                mCurrentUserId, userId);
                + " from %d to %d for test automation purposes", mCurrentUserId, userId);
        mRealCurrentUserId = mCurrentUserId;
        mRealCurrentUserId = mCurrentUserId;
        switchUser(userId);
        switchUser(userId);
    }
    }
@@ -1466,7 +1468,13 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
                    + "because device doesn't support visible background users");
                    + "because device doesn't support visible background users");
            return;
            return;
        }
        }
        Slogf.i(LOG_TAG, "Restoring current user to %d after using %d for test automation purposes",
        if (mRealCurrentUserId == UserHandle.USER_CURRENT) {
            Slogf.d(LOG_TAG, "restoreCurrentUserForTestAutomationIfNeededLocked(): ignoring "
                    + "because mRealCurrentUserId is already USER_CURRENT");
            return;
        }
        Slogf.i(LOG_TAG, "restoreCurrentUserForTestAutomationIfNeededLocked(): restoring current "
                + "user to %d after using %d for test automation purposes",
                mRealCurrentUserId, mCurrentUserId);
                mRealCurrentUserId, mCurrentUserId);
        int currentUserId = mRealCurrentUserId;
        int currentUserId = mRealCurrentUserId;
        mRealCurrentUserId = UserHandle.USER_CURRENT;
        mRealCurrentUserId = UserHandle.USER_CURRENT;