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

Commit cfc68b66 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Allow ManagedProvisioning to silently uninstall apps"

parents e2fddf56 879f879d
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@
package com.android.server.pm;
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.READ_EXTERNAL_STORAGE;
import static android.Manifest.permission.WRITE_EXTERNAL_STORAGE;
import static android.Manifest.permission.WRITE_EXTERNAL_STORAGE;
import static android.Manifest.permission.WRITE_MEDIA_STORAGE;
import static android.Manifest.permission.WRITE_MEDIA_STORAGE;
@@ -15627,6 +15628,14 @@ public class PackageManagerService extends IPackageManager.Stub {
                callingUid == getPackageUid(mStorageManagerPackage, 0, callingUserId)) {
                callingUid == getPackageUid(mStorageManagerPackage, 0, callingUserId)) {
            return true;
            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;
        return false;
    }
    }