Merge "Address API Review for setProfileOwnerCanAccessDeviceIds" into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
7924f675e1
@@ -11496,7 +11496,11 @@ public class DevicePolicyManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Deprecated. Use {@code markProfileOwnerOnOrganizationOwnedDevice} instead.
|
* 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.
|
* @deprecated Use {@link #markProfileOwnerOnOrganizationOwnedDevice} instead.
|
||||||
*
|
*
|
||||||
@@ -11507,9 +11511,14 @@ public class DevicePolicyManager {
|
|||||||
@RequiresPermission(value = android.Manifest.permission.GRANT_PROFILE_OWNER_DEVICE_IDS_ACCESS,
|
@RequiresPermission(value = android.Manifest.permission.GRANT_PROFILE_OWNER_DEVICE_IDS_ACCESS,
|
||||||
conditional = true)
|
conditional = true)
|
||||||
public void setProfileOwnerCanAccessDeviceIds(@NonNull ComponentName who) {
|
public void setProfileOwnerCanAccessDeviceIds(@NonNull ComponentName who) {
|
||||||
throw new UnsupportedOperationException(
|
ApplicationInfo ai = mContext.getApplicationInfo();
|
||||||
"This method is deprecated. use markProfileOwnerOnOrganizationOwnedDevice instead"
|
if (ai.targetSdkVersion > Build.VERSION_CODES.Q) {
|
||||||
+ ".");
|
throw new UnsupportedOperationException(
|
||||||
|
"This method is deprecated. use markProfileOwnerOnOrganizationOwnedDevice"
|
||||||
|
+ " instead.");
|
||||||
|
} else {
|
||||||
|
markProfileOwnerOnOrganizationOwnedDevice(who);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user