最終更新:2016-02-26 (金) 18:03:26 (2953d)
UsbManager.getDeviceList
Top / UsbManager.getDeviceList
Returns a HashMap containing all USB devices currently attached. USB device name is the key for the returned HashMap. The result will be empty if no devices are attached, or if USB host mode is inactive or unsupported.
http://developer.android.com/intl/ja/reference/android/hardware/usb/UsbManager.html#getDeviceList()
Returns
実装
メモ
- IUsbManager mService;.
- com.android.server.usb.UsbService extends IUsbManager.Stub
- mService.getDeviceList?(bundle);
HIDのデバイスが列挙されない時がある
- http://tools.oesf.biz/android-5.1.1_r1.0/xref/frameworks/base/services/usb/java/com/android/server/usb/UsbHostManager.java#98
- com.android.server.usb.UsbHostManager
/* returns true if the USB device should not be accessible by applications */ private boolean isBlackListed(int clazz, int subClass, int protocol) { // blacklist hubs if (clazz == UsbConstants.USB_CLASS_HUB) return true; // blacklist HID boot devices (mouse and keyboard) if (clazz == UsbConstants.USB_CLASS_HID && subClass == UsbConstants.USB_INTERFACE_SUBCLASS_BOOT) { return true; } return false; }