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

Commit fc5c78e0 authored by insight.lee's avatar insight.lee Committed by android-build-merger
Browse files

Merge "Allow ManagedProvisioning to silently uninstall apps" am: cfc68b66

am: 6683494c

Change-Id: I9f0092630e3b89f708b3f157e1c36052297458db
parents 26d64311 6683494c
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
package com.android.server.pm;
import static android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS;
import static android.Manifest.permission.READ_EXTERNAL_STORAGE;
import static android.Manifest.permission.WRITE_EXTERNAL_STORAGE;
import static android.Manifest.permission.WRITE_MEDIA_STORAGE;
@@ -15645,6 +15646,14 @@ public class PackageManagerService extends IPackageManager.Stub {
                callingUid == getPackageUid(mStorageManagerPackage, 0, callingUserId)) {
            return true;
        }
        // Allow caller having MANAGE_PROFILE_AND_DEVICE_OWNERS permission to silently
        // uninstall for device owner provisioning.
        if (checkUidPermission(MANAGE_PROFILE_AND_DEVICE_OWNERS, callingUid)
                == PERMISSION_GRANTED) {
            return true;
        }
        return false;
    }