I have an app and an accessory and I'm having issues with the USB_ACCESSORY_ATTATCHED intent not being fired when the device is booted and the accessory is already plugged in. The workflow works great when the device is on and the user plugs in the accessory so I'm positive I set the intent filter up correctly.
My manifest
<activity
android:name=".Activity"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" />
</intent-filter>
<meta-data
android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED"
android:resource="@xml/accessory_filter" />
</activity>
On the accessory side, I see that the phone gets put in accessory mode before it's even booted and I'm guessing that is the issue. Unfortunately prompting for usb permissions isn't feasible as the user may not have access to the androids ui and that function only gives temporary access.