Factored out the USBBroadcastReceiver.

This was copied from the other project where I actually got it running.