From 0589baeae9ebb12285eae52c6e3e4517b2477ca3 Mon Sep 17 00:00:00 2001 From: Alex Johnston Date: Wed, 10 Jun 2020 09:58:01 +0100 Subject: [PATCH] Update setCameraDisabled javadoc * DA targeting pre-Q will have this request silently ignored Bug: 157212233 Test: build Change-Id: I5b993443cdbcb2afed9f65c9d01063e7e1777842 --- .../android/app/admin/DevicePolicyManager.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java index c65064324c8cd..1f90e401dee5e 100644 --- a/core/java/android/app/admin/DevicePolicyManager.java +++ b/core/java/android/app/admin/DevicePolicyManager.java @@ -5868,12 +5868,22 @@ public class DevicePolicyManager { * returned by {@link #getParentProfileInstance(ComponentName)}, where the caller must be * the profile owner of an organization-owned managed profile. *

- * If the caller is device owner or called on the parent instance, then the - * restriction will be applied to all users. + * If the caller is device owner, then the restriction will be applied to all users. If + * called on the parent instance, then the restriction will be applied on the personal profile. *

* The calling device admin must have requested * {@link DeviceAdminInfo#USES_POLICY_DISABLE_CAMERA} to be able to call this method; if it has * not, a security exception will be thrown. + *

+ * Note, this policy type is deprecated for legacy device admins since + * {@link android.os.Build.VERSION_CODES#Q}. On Android + * {@link android.os.Build.VERSION_CODES#Q} devices, legacy device admins targeting SDK + * version {@link android.os.Build.VERSION_CODES#P} or below can still call this API to + * disable camera, while legacy device admins targeting SDK version + * {@link android.os.Build.VERSION_CODES#Q} will receive a SecurityException. Starting + * from Android {@link android.os.Build.VERSION_CODES#R}, requests to disable camera from + * legacy device admins targeting SDK version {@link android.os.Build.VERSION_CODES#P} or + * below will be silently ignored. * * @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @param disabled Whether or not the camera should be disabled.