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

Commit 759c9b96 authored by Kenny Guy's avatar Kenny Guy Committed by Android (Google) Code Review
Browse files

Merge "Fix bug with removeUser assuming it is called from system uid."

parents c33fb2b5 ee58b4f4
Loading
Loading
Loading
Loading
+46 −42
Original line number Diff line number Diff line
@@ -1140,6 +1140,8 @@ public class UserManagerService extends IUserManager.Stub {
     */
    public boolean removeUser(int userHandle) {
        checkManageUsersPermission("Only the system can remove users");
        long ident = Binder.clearCallingIdentity();
        try {
            final UserInfo user;
            synchronized (mPackagesLock) {
                user = mUsers.get(userHandle);
@@ -1185,8 +1187,10 @@ public class UserManagerService extends IUserManager.Stub {
            } catch (RemoteException e) {
                return false;
            }

            return res == ActivityManager.USER_OP_SUCCESS;
        } finally {
            Binder.restoreCallingIdentity(ident);
        }
    }

    void finishRemoveUser(final int userHandle) {