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

Commit b7794121 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Removed permission check from DPMI.getDeviceOwnerUserId()" into main

parents bdd2d660 76d799c9
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -1424,13 +1424,7 @@ public class UserManagerService extends IUserManager.Stub {
        if (dpmi == null) {
            return UserHandle.USER_NULL;
        }
        // TODO(b/435271558): change dpmi.getDeviceOwnerUserId() so it doesn't check for permissions
        long ident = Binder.clearCallingIdentity();
        try {
        return dpmi.getDeviceOwnerUserId();
        } finally {
            Binder.restoreCallingIdentity(ident);
        }
    }

    @Override
+4 −1
Original line number Diff line number Diff line
@@ -10307,7 +10307,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
            return UserHandle.USER_NULL;
        }
        Preconditions.checkCallAuthorization(canManageUsers(getCallerIdentity()));
        return getDeviceOwnerUserIdUnchecked();
    }
    private @UserIdInt int getDeviceOwnerUserIdUnchecked() {
        synchronized (getLockObject()) {
            return getDeviceOwnerUserIdUncheckedLocked();
        }
@@ -16494,7 +16497,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
        @Override
        public int getDeviceOwnerUserId() {
            return DevicePolicyManagerService.this.getDeviceOwnerUserId();
            return DevicePolicyManagerService.this.getDeviceOwnerUserIdUnchecked();
        }
        @Override