Merge "Proper fix for setDeviceOwner() permission check." into sc-v2-dev am: f70489f2d0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15953790 Change-Id: I64e728a54e89c7151e80eecb75c89b77f53c889e
This commit is contained in:
@@ -10633,6 +10633,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
final String adminPkg = admin.getPackageName();
|
final String adminPkg = admin.getPackageName();
|
||||||
|
mInjector.binderWithCleanCallingIdentity(() -> {
|
||||||
try {
|
try {
|
||||||
// Install the profile owner if not present.
|
// Install the profile owner if not present.
|
||||||
if (!mIPackageManager.isPackageAvailable(adminPkg, userId)) {
|
if (!mIPackageManager.isPackageAvailable(adminPkg, userId)) {
|
||||||
@@ -10646,6 +10647,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
|
|||||||
Slogf.wtf(LOG_TAG, e, "Failed to install admin package %s for user %d",
|
Slogf.wtf(LOG_TAG, e, "Failed to install admin package %s for user %d",
|
||||||
adminPkg, userId);
|
adminPkg, userId);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Set admin.
|
// Set admin.
|
||||||
setActiveAdmin(profileOwner, /* refreshing= */ true, userId);
|
setActiveAdmin(profileOwner, /* refreshing= */ true, userId);
|
||||||
|
|||||||
Reference in New Issue
Block a user