USB Host Mode - device access permission granted but not remembered

后端 未结 3 633
一向
一向 2021-02-12 15:08

I have a USB Host Mode application that works perfectly. I plug in the device, Android pops up the Allow the app APPNAME to access the USB device? permission r

相关标签:
3条回答
  • 2021-02-12 15:15

    I answered this here, although I gather that duplicates across other SE sites are permitted.

    In answer to why, it is as you surmised in said thread; because with your hardware you get different identifiers each time you connect, e.g. /dev/bus/usb/001/, /dev/bus/usb/002/ and so on.

    0 讨论(0)
  • 2021-02-12 15:18

    This is a dup of USB device access pop-up supression?. Basically the answer is to use an intent-filter on USB_DEVICE_ATTACHED and steer clear of the RequestPermission USB Host Mode API call.

    0 讨论(0)
  • 2021-02-12 15:20

    The Android just cannot remember my grant for my device But fortunately, I figured out the reason: I used hex values in the device_filter.xml. After I changed it to decimal values, everything just works fine. My Android can remember my permit then.

    0 讨论(0)
提交回复
热议问题