Merge "Drive-by clean-up: remove redundant operation" into sc-dev

This commit is contained in:
Pavel Grafov
2021-04-26 19:15:05 +00:00
committed by Android (Google) Code Review

View File

@@ -16771,7 +16771,9 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
provisioningParams.isKeepAccountMigrated(), callerPackage);
if (provisioningParams.isOrganizationOwnedProvisioning()) {
setProfileOwnerOnOrgOwnedDeviceState(admin, userInfo.id, caller.getUserId());
synchronized (getLockObject()) {
markProfileOwnerOnOrganizationOwnedDeviceUncheckedLocked(admin, userInfo.id);
}
}
return userInfo.getUserHandle();
@@ -17003,22 +17005,6 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
}
}
private void setProfileOwnerOnOrgOwnedDeviceState(
ComponentName admin, @UserIdInt int profileId, @UserIdInt int parentUserId) {
synchronized (getLockObject()) {
markProfileOwnerOnOrganizationOwnedDeviceUncheckedLocked(admin, profileId);
}
restrictRemovalOfManagedProfile(parentUserId);
}
private void restrictRemovalOfManagedProfile(@UserIdInt int parentUserId) {
final UserHandle parentUserHandle = UserHandle.of(parentUserId);
mUserManager.setUserRestriction(
UserManager.DISALLOW_REMOVE_MANAGED_PROFILE,
/* value= */ true,
parentUserHandle);
}
@Override
public void provisionFullyManagedDevice(
@NonNull FullyManagedDeviceProvisioningParams provisioningParams,