| | |
| | | /** |
| | | * 尝试是否有连接设备(OTG) |
| | | */ |
| | | public void tryAttcheDeviceHandle(Context context, IUsbDevicePlugDelegate iUsbDevicePlugDelegate) { |
| | | public int tryAttcheDeviceHandle(Context context, IUsbDevicePlugDelegate iUsbDevicePlugDelegate) { |
| | | Log.d("fwup","tryAttcheDeviceHandle: "); |
| | | this.iUsbDevicePlugDelegate = iUsbDevicePlugDelegate; |
| | | mUsbManager = (UsbManager) context.getSystemService(USB_SERVICE); |
| | |
| | | }*/ |
| | | |
| | | ArrayList<UsbDevice> devices = acceptOTGDeviceInfo(mUsbManager); |
| | | |
| | | if (devices==null || devices.size()==0){ |
| | | Log.i("fwup","devices==null"); |
| | | return 1; |
| | | } |
| | | for (UsbDevice dev: devices) { |
| | | acceptLicense(context, dev); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | //<<<--------------------------------------- Usb 相关处理-------------------------------------------- |