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

Commit adaa8ade authored by Alex Johnston's avatar Alex Johnston Committed by Automerger Merge Worker
Browse files

Merge "Only a test admin can be unmarked as a COPE admin" into tm-dev am:...

Merge "Only a test admin can be unmarked as a COPE admin" into tm-dev am: 9736fb2a am: 25211cdd am: fe1a1c1a

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17822403



Change-Id: I94badef42a30e9d86ecf2857615ea461fa1dc7dd
Ignore-AOSP-First: this is an automerge
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 3bca7d35 fe1a1c1a
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -14656,6 +14656,13 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
            throw new SecurityException(
                    "Only the system can mark a profile owner of organization-owned device.");
        }
        // Only a test admin can be unmarked as a profile owner on an organization-owned device.
        synchronized (getLockObject()) {
            if (!isProfileOwnerOnOrganizationOwnedDevice && !isAdminTestOnlyLocked(who, userId)) {
                throw new SecurityException("Only a test admin can be unmarked as a "
                        + "profile owner of organization-owned device.");
            }
        }
        if (isAdb(caller)) {
            if (hasIncompatibleAccountsOrNonAdbNoLock(caller, userId, who)) {