public void RequestPermission(int paramInt) {
byte b = 1;
UsbManager usbManager = (UsbManager)BA.applicationContext.getSystemService("usb");
HashMap hashMap = usbManager.getDeviceList();
if (hashMap.size() > 0)
for (UsbDevice usbDevice : hashMap.values()) {
if (b++ == paramInt) {
usbManager.requestPermission(usbDevice, PendingIntent.getBroadcast((Context)BA.applicationContext, 0, new Intent("com.android.example.USB_PERMISSION"), 0));
return;
}
}
UsbAccessory[] arrayOfUsbAccessory = usbManager.getAccessoryList();
if (arrayOfUsbAccessory != null)
usbManager.requestPermission(arrayOfUsbAccessory[0], PendingIntent.getBroadcast((Context)BA.applicationContext, 0, new Intent("com.android.example.USB_PERMISSION"), 0));
}