i'm creating kiosk application which need USB permissions. It's going to be added at AOSP image as system app on our device and it's device owner app.
Application controls external device via USB on HOST mode so how it can get USB permission by default so that user doesn't need to give to every time when USB device will be powered off. Tablet will be closed casing so user doesn't have access to usb port and device which it controlling.
So i want certain USB device to be trusted by default. How to achieve it? How i can bypass android usb host permission confirmation dialog for my application.
Can this method used??
Then i found out something about whitelisting the devices. Going to try it tomorrow if it could be viable solution.
I have the same problem, in your AndroidManifest.xml in the Activity that use the Device write this
you also have to create a filter file in your xml resources, eg res/xml/device_filter:
you must not call mManager.requestPermission(device, mPermissionIntent), so you have to directly call mManager.openDevice(mDevice); and you can communicate normally without the need appear permission pop-up message.