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

Commit 54e6bddf authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Address API Review for setProfileOwnerCanAccessDeviceIds" into rvc-dev...

Merge "Address API Review for setProfileOwnerCanAccessDeviceIds" into rvc-dev am: 7924f675 am: 8872a16b

Change-Id: Ib73e8ccf9606a40b9544fdb97a5cdb1a380966b3
parents 6130335a 8872a16b
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
@@ -11496,7 +11496,11 @@ public class DevicePolicyManager {
    /**
     * Deprecated. Use {@code markProfileOwnerOnOrganizationOwnedDevice} instead.
     * Throws UnsupportedOperationException when called.
     * When called by an app targeting SDK level {@link android.os.Build.VERSION_CODES#Q} or
     * below, will behave the same as {@link #markProfileOwnerOnOrganizationOwnedDevice}.
     *
     * When called by an app targeting SDK level {@link android.os.Build.VERSION_CODES#R}
     * or above, will throw an UnsupportedOperationException when called.
     *
     * @deprecated Use {@link #markProfileOwnerOnOrganizationOwnedDevice} instead.
     *
@@ -11507,9 +11511,14 @@ public class DevicePolicyManager {
    @RequiresPermission(value = android.Manifest.permission.GRANT_PROFILE_OWNER_DEVICE_IDS_ACCESS,
            conditional = true)
    public void setProfileOwnerCanAccessDeviceIds(@NonNull ComponentName who) {
        ApplicationInfo ai = mContext.getApplicationInfo();
        if (ai.targetSdkVersion > Build.VERSION_CODES.Q) {
            throw new UnsupportedOperationException(
                "This method is deprecated. use markProfileOwnerOnOrganizationOwnedDevice instead"
                        + ".");
                    "This method is deprecated. use markProfileOwnerOnOrganizationOwnedDevice"
                    + " instead.");
        } else {
            markProfileOwnerOnOrganizationOwnedDevice(who);
        }
    }
    /**