Revert "Bypassing available user check for profiles."

Revert Change-Id: I22b0344b376f5d729ba5b70fd9d0315ff34d19e8

Bug: 271588557
Test: atest CtsAppCloningHostTest
Test: atest CtsAppCloningDeviceTestCases
Change-Id: I6de154274bcb8567d22773259075930a08ffe1f2
This commit is contained in:
Sarup Dalwani
2023-03-06 17:54:31 +00:00
parent 37ea5f6833
commit 3168c245dc

View File

@@ -4645,9 +4645,9 @@ public class UserManagerService extends IUserManager.Stub {
UserManager.USER_OPERATION_ERROR_MAX_USERS);
}
// Keep logic in sync with getRemainingCreatableUserCount()
if (!isGuest && !isProfile && !isDemo && isUserLimitReached()) {
if (!isGuest && !isManagedProfile && !isDemo && isUserLimitReached()) {
// If the user limit has been reached, we cannot add a user (except guest/demo).
// Note that profiles can bypass it in certain circumstances (taken
// Note that managed profiles can bypass it in certain circumstances (taken
// into account in the profile check below).
throwCheckedUserOperationException(
"Cannot add user. Maximum user limit is reached.",