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

Commit 9857a76c authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fixed mark-profile-owner-on-organization-owned-device for non-profile users" into sc-dev

parents 4e50cf24 8cf30ff9
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -13726,6 +13726,9 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
        mInjector.binderWithCleanCallingIdentity(() -> {
            // Clear restriction as user.
            final UserHandle parentUser = mUserManager.getProfileParent(UserHandle.of(userId));
            if (parentUser == null) {
                throw new IllegalStateException(String.format("User %d is not a profile", userId));
            }
            if (!parentUser.isSystem()) {
                throw new IllegalStateException(
                        String.format("Only the profile owner of a managed profile on the"