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

Commit 98df36d3 authored by Sarup Dalwani's avatar Sarup Dalwani
Browse files

Bypassing available user check for profiles.

As profiles have check for max available profiles, bypassing available
user check for profiles. Managed profile already bypass this check we
need to bypass for clone as well. This looks more general profile use
case as compared to just managed profile check.

Bug: 242455040
Test: atest CtsAppCloningHostTest
Test: atest CtsAppCloningDeviceTestCases
Change-Id: I22b0344b376f5d729ba5b70fd9d0315ff34d19e8
parent b6336476
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -4209,9 +4209,9 @@ public class UserManagerService extends IUserManager.Stub {
                            UserManager.USER_OPERATION_ERROR_MAX_USERS);
                }
                // Keep logic in sync with getRemainingCreatableUserCount()
                if (!isGuest && !isManagedProfile && !isDemo && isUserLimitReached()) {
                if (!isGuest && !isProfile && !isDemo && isUserLimitReached()) {
                    // If the user limit has been reached, we cannot add a user (except guest/demo).
                    // Note that managed profiles can bypass it in certain circumstances (taken
                    // Note that profiles can bypass it in certain circumstances (taken
                    // into account in the profile check below).
                    throwCheckedUserOperationException(
                            "Cannot add user. Maximum user limit is reached.",