Android Question How to disable camera in Android 11?

noeleon

Active Member
Licensed User
Starting in Android 11 the cameras can no longer be disabled by admin apps. Is there another way to do it?
 

noeleon

Active Member
Licensed User
https://developer.android.com/reference/android/app/admin/DevicePolicyManager

The calling device admin must have requested 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 Build.VERSION_CODES.Q. On Android Build.VERSION_CODES.Q devices, legacy device admins targeting SDK version Build.VERSION_CODES.P or below can still call this API to disable camera, while legacy device admins targeting SDK version Build.VERSION_CODES.Q will receive a SecurityException. Starting from Android Build.VERSION_CODES.R, requests to disable camera from legacy device admins targeting SDK version Build.VERSION_CODES.P or below will be silently ignored.
 
Upvote 0
Top