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

Commit e6d38c3e authored by Jonathan Scott's avatar Jonathan Scott
Browse files

Remove limitation that only profiles from the system user can be COPE.

Test: btest CtsDevicePolicyTestCases -s w --headless
Bug: 242189747
Change-Id: I899341de667fd4fcf18b8b6509dc8902baccd4b2
parent 46b0e5ff
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -14696,12 +14696,6 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
            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"
                                + " primary user can be granted access to device identifiers, not"
                                + " on user %d", parentUser.getIdentifier()));
            }
            mUserManager.setUserRestriction(UserManager.DISALLOW_REMOVE_MANAGED_PROFILE,
                    isProfileOwnerOnOrganizationOwnedDevice,