title: Use the device_filter.xml resource file to filter USB enumeration results
body: <p>Following the instructions in the <a href="http://developer.android.com/guide/topics/connectivity/usb/host.html#discovering-d" rel="nofollow">Android USB Host documentation</a>, I managed to detect new USB devices via a <code>USB_DEVICE_ATTACHED</code> intent. To restrict notifications to certain devices, a resource file can be specified:</p>
  
  <pre><code>&lt;activity ...&gt;
  ...
      &lt;intent-filter&gt;
          &lt;action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" /&gt;
      &lt;/intent-filter&gt;
  
      &lt;meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
          android:resource="@xml/device_filter" /&gt;
  &lt;/activity&gt;
  </code></pre>
  
  <p>device_filter.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;resources&gt;
      &lt;usb-device vendor-id="1234" product-id="5678" /&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p>The problem is, if the service starts after the USB device is inserted, no intent is received. I can use <a href="http://developer.android.com/reference/android/hardware/usb/UsbManager.html#getDeviceList%28%29" rel="nofollow"><code>getDeviceList</code></a> to obtain a list of devices, but wish to avoid duplicating the filter conditions from the <code>device_filter.xml</code> file. Is that possible?</p>