I am developing an application in which I am communicating with an USB device. When I connect the USB device for the first time and run the application, it asks for the USB permission.
I want to suppress that dialog so it won't prompt the user anymore. I know that it asks for user permission as per the results I've found so far, however I want to know whether the dialog can be suppressed.
Is their any way by which the user can assign the permissions at install time and wont get that USB permission dialog box?
I think that the answer is that it is not possible.
I have not found a way to suppress this so far. I think that this is primarily down to the fact that the permission is granted to a specific device and of course the device is not likely to be known at install time.
What you would effectively need is a blanket "any USB device" permission and I certainly have not found such a thing so far.
I can take none of the credit for this, but the answer is that it can be done using an intent-filter on USB_DEVICE_ATTACHED - see USB device access pop-up supression? for the solution, including a handy demo app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With