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

Commit 76d799c9 authored by Felipe Leme's avatar Felipe Leme
Browse files

Removed permission check from DPMI.getDeviceOwnerUserId()

Test: manual verification
Flag: EXEMPT mechanical refactoring
Bug: 435271558

Change-Id: I72e23911f62291a9a72f45f729ff1873493a9108
parent db641f91
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -1419,13 +1419,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
@@ -10306,7 +10306,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();
        }
@@ -16493,7 +16496,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
        @Override
        public int getDeviceOwnerUserId() {
            return DevicePolicyManagerService.this.getDeviceOwnerUserId();
            return DevicePolicyManagerService.this.getDeviceOwnerUserIdUnchecked();
        }
        @Override