Improve USBClientActivity to handle different accessory events (ACTION_USB_ACCESSORY_ATTACHED is found not to work inside acitivity here, so it would be removed in the next commit)