Thursday, 27 June 2019

Grant USB permissions as device owner

A device owner can grant runtime permissions to a third-party app using DevicePolicyManager.setPermissionGrantState() to avoid user prompts.

But is there any way for a device owner to grant USB permissions as well, so that this app gets access to plugged USB devices without user prompt ?

I've also tried to call UsbManager.grantPermission() (with reflection) but it raises a SecurityException since it requires the MANAGE_USB permission which is granted only to system apps (and not to device owner, obviously).

NB: I'm looking for a solution working on a non-root & non-custom Android system, the device owner app is set using Android Enterprise provisioning methods.



from Grant USB permissions as device owner

No comments:

Post a Comment