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

Commit df30c7d2 authored by Eric Sandness's avatar Eric Sandness
Browse files

Permission Check For DPM.isDeviceProvisioned

Require the caller of DPM.isDeviceProvisioned() to hold the MANAGE_USERS
permission.  The only callers should be within the framework itself, or
apps involved in device provisioning which already hold this permission.

Bug: 62343414
Test: Set TestDPC as Device Owner and use it to reset password
Test: com.android.server.devicepolicy.DevicePolicyManagerTest
Test: com.android.server.locksettings.LockSettingsServiceTests
Test: com.google.android.gts.devicepolicy.DevicePolicyManagerTest
Change-Id: Ie53deb5ba8679a5b431f2a8da60ec9710c44d56f
parent af13eeb1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -8754,6 +8754,7 @@ public class DevicePolicyManager {
     * @hide
     */
    @SystemApi
    @RequiresPermission(android.Manifest.permission.MANAGE_USERS)
    public boolean isDeviceProvisioned() {
        try {
            return mService.isDeviceProvisioned();
+1 −0
Original line number Diff line number Diff line
@@ -11815,6 +11815,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
    @Override
    public boolean isDeviceProvisioned() {
        enforceManageUsers();
        synchronized (this) {
            return getUserDataUnchecked(UserHandle.USER_SYSTEM).mUserSetupComplete;
        }