We have an application that uses Android and USB on the go to communicate with an Ardupilot. Our phone is logging information from the ardupilot and some other things. The problem is that often when logging we don't have easy access to the screen of the phone. This means that if we have a problem where a USB cable loosens(which happens a bit to often) we need access to the screen to grant permission to the USB device. Is there any way to grant permission always. The application is only internal so we are not that worried about security, but need the convenience.
Note: We have tried to select the "Remember this choice in future", but the dialog always opens and it doesn't seem to remember our choice.
Edit: As requested the manifest lines where we have requested USB:
<uses-feature android:name="android.hardware.usb.host" />
...
<activity
android:name="..."
android:configChanges="orientation|keyboardHidden"
android:label="@string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
<meta-data
android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
android:resource="@xml/device_filter" />
</intent-filter>
</activity>
Here is our device filter:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- 0x0403 / 0x6001: FTDI FT232R UART -->
<usb-device vendor-id="1027" product-id="24577" />
<!-- 0x0403 / 0x6015: FTDI FT232R UART -->
<usb-device vendor-id="1027" product-id="24597" />
<!-- 0x2341 / 0x0010: APM 2.5 device -->
<usb-device vendor-id="9025" product-id="16" />
<!-- 0x26ac / 0x0010: APM 2.5 device -->
<usb-device vendor-id="9900" product-id="16" />
<!-- 0x2341 / Arduino -->
<usb-device vendor-id="9025" />
<!-- 0x16C0 / 0x0483: Teensyduino -->
<usb-device vendor-id="5824" product-id="1155" />
<!-- 0x10C4 / 0xEA60: CP210x UART Bridge -->
<usb-device vendor-id="4292" product-id="60000" />
</resources>