Merge "Fix DefaultSmsApplicationTest for organization-owned profile owner" into udc-dev

This commit is contained in:
Rubin Xu
2023-03-09 11:06:34 +00:00
committed by Android (Google) Code Review

View File

@@ -11219,7 +11219,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
} else { } else {
Objects.requireNonNull(admin, "ComponentName is null"); Objects.requireNonNull(admin, "ComponentName is null");
Preconditions.checkCallAuthorization(isDefaultDeviceOwner(caller) Preconditions.checkCallAuthorization(isDefaultDeviceOwner(caller)
|| (parent && isProfileOwnerOfOrganizationOwnedDevice(caller))); || isProfileOwnerOfOrganizationOwnedDevice(caller));
} }
if (parent) { if (parent) {
userId = getProfileParentId(mInjector.userHandleGetCallingUserId()); userId = getProfileParentId(mInjector.userHandleGetCallingUserId());