I have an app with optional Bluetooth functionality for communicating between a desktop and the phone. I would like to know whether the end user is unable to use Bluetooth in my app because an administrator prevents the usage of Bluetooth by policy using a Mobile Device Manager.
(Here is example of applying such a policy: https://jumpcloud.com/support/create-an-android-bluetooth-restrictions-policy)
Can this be detected in the code of an end user app and if so, how?
I know you can request and get permissions using techniques in https://developer.android.com/training/permissions/requesting
but as far as I can see, only the values PackageManager.PERMISSION_GRANTED
or PackageManager.PERMISSION_DENIED
are returned, not for example PackageManager.PERMISSION_RESTRICTED_BY_ADMIN
.
Android-D is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.