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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.