3

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?

Michael Celey
  • 12,645
  • 6
  • 57
  • 62
NK-
  • 127
  • 2
  • 4
  • 5
  • possible duplicate of [USB device access pop-up supression?](http://stackoverflow.com/questions/12388914/usb-device-access-pop-up-supression) – CAMOBAP May 11 '15 at 08:46

2 Answers2

2

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.

Neil
  • 539
  • 3
  • 11
2

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.

Community
  • 1
  • 1
kbro
  • 4,754
  • 7
  • 29
  • 40
  • Will something like this work on a desktop (i.e. Ubuntu 10.04)? I'm trying to suppress the "Allow USB debugging?" dialog when I connect my Nexus 10 to my desktop so I can do automation after a device reboot. – Android Noob Jun 19 '13 at 19:48