Merge "Revert "Fixed DPMS.setDeviceOwner() permission check."" into sc-v2-dev am: 71fb7767d4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15942864 Change-Id: I4d79a4bc3748257c5c1b23abef74c6173921ec5f
This commit is contained in:
@@ -8418,20 +8418,18 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
|
|||||||
mDeviceAdminServiceController.startServiceForOwner(
|
mDeviceAdminServiceController.startServiceForOwner(
|
||||||
admin.getPackageName(), userId, "set-device-owner");
|
admin.getPackageName(), userId, "set-device-owner");
|
||||||
|
|
||||||
Slogf.i(LOG_TAG, "Device owner set: %s on user %d", admin.flattenToShortString(),
|
Slogf.i(LOG_TAG, "Device owner set: " + admin + " on user " + userId);
|
||||||
userId);
|
|
||||||
|
|
||||||
if (setProfileOwnerOnCurrentUserIfNecessary
|
if (setProfileOwnerOnCurrentUserIfNecessary
|
||||||
&& mInjector.userManagerIsHeadlessSystemUserMode()) {
|
&& mInjector.userManagerIsHeadlessSystemUserMode()) {
|
||||||
int currentForegroundUser = getCurrentForegroundUserId();
|
int currentForegroundUser = getCurrentForegroundUserId();
|
||||||
Slogf.i(LOG_TAG, "setDeviceOwner(): setting %s as profile owner on user %d",
|
Slogf.i(LOG_TAG, "setDeviceOwner(): setting " + admin
|
||||||
admin.flattenToShortString(), currentForegroundUser);
|
+ " as profile owner on user " + currentForegroundUser);
|
||||||
// Sets profile owner on current foreground user since
|
// Sets profile owner on current foreground user since
|
||||||
// the human user will complete the DO setup workflow from there.
|
// the human user will complete the DO setup workflow from there.
|
||||||
mInjector.binderWithCleanCallingIdentity(() -> manageUserUnchecked(
|
manageUserUnchecked(/* deviceOwner= */ admin, /* profileOwner= */ admin,
|
||||||
/* deviceOwner= */ admin, /* profileOwner= */ admin,
|
|
||||||
/* managedUser= */ currentForegroundUser, /* adminExtras= */ null,
|
/* managedUser= */ currentForegroundUser, /* adminExtras= */ null,
|
||||||
/* showDisclaimer= */ false));
|
/* showDisclaimer= */ false);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user