Android usb attached permission

Hi,

I have to use a USB device on the board but unfortunately Android is asking, after each boot, the authorization to use this USB device.

Do you have any workaround in order to disable this message.

One solution is to change the config_disableUsbPermissionDialogs property to true in the Android system image but if I prefer to ask before going through this way…

Regards,

can you send me the picture of message and tell me the firmware version?

Problem was solved with usb_device_filter.xml workaround.

In the Manifest activity tag, where USB is needed, add :

<meta-data 
    android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
    android:resource="@xml/usb_device_filter" 
/>

Create a usb_device_filter file in xml resource folder and add :

<?xml version="1.0" encoding="utf-8"?>
<resources>
     <usb-device vendor-id="1234" product-id="56789" />
</resources>

Where vendor-id and product-id are converted in integer, not hexadecimal !

Regards,

1 Like