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

Commit 75175025 authored by Julia Reynolds's avatar Julia Reynolds
Browse files

If DISALLOW_ADD_USER is enabled, do not allow users to be created.

Bug: 15910634
Change-Id: I7e14bf7d71001f218402a5d90e2aadc54fcfd875
parent 5622e8b6
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1047,6 +1047,11 @@ public class UserManagerService extends IUserManager.Stub {
    }

    private UserInfo createUserInternal(String name, int flags, int parentId) {
        if (getUserRestrictions(UserHandle.getCallingUserId()).getBoolean(
                UserManager.DISALLOW_ADD_USER, false)) {
            Log.w(LOG_TAG, "Cannot add user. DISALLOW_ADD_USER is enabled.");
            return null;
        }
        final long ident = Binder.clearCallingIdentity();
        UserInfo userInfo = null;
        try {