Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I suppress the USB permissions dialog?

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?

like image 495
NK- Avatar asked Oct 23 '25 14:10

NK-


2 Answers

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.

like image 189
Neil Avatar answered Oct 26 '25 08:10

Neil


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.

like image 30
kbro Avatar answered Oct 26 '25 06:10

kbro



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!