public void addOrUpdateUsbDevice ( UsbDevice usbDevice , boolean hasPermission ) { Preconditions . checkNotNull ( usbDevice ) ; Preconditions . checkNotNull ( usbDevice . getDeviceName ( ) ) ; usbDevices . put ( usbDevice . getDeviceName ( ) , usbDevice ) ; if ( hasPermission ) { grantPermission ( usbDevice ) ; } else { revokePermission ( usbDevice , RuntimeEnvironment . application . getPackageName ( ) ) ; } }
Adds a USB device into available USB devices map with permission value . If the USB device already exists updates the USB device with new permission value .