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

Commit 37271629 authored by Julia Reynolds's avatar Julia Reynolds Committed by Android (Google) Code Review
Browse files

Merge "If DISALLOW_REMOVE_USER is enabled, UserManager.removeUser should not remove users."

parents 0e83b499 4ac5f854
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1108,6 +1108,12 @@ public class UserManagerService extends IUserManager.Stub {
     */
    public boolean removeUser(int userHandle) {
        checkManageUsersPermission("Only the system can remove users");
        if (getUserRestrictions(UserHandle.getCallingUserId()).getBoolean(
                UserManager.DISALLOW_REMOVE_USER, false)) {
            Log.w(LOG_TAG, "Cannot remove user. DISALLOW_REMOVE_USER is enabled.");
            return false;
        }

        long ident = Binder.clearCallingIdentity();
        try {
            final UserInfo user;