public boolean hasPermissionForPackage ( UsbDevice device , String packageName ) { List < UsbDevice > usbDevices = grantedPermissions . get ( packageName ) ; return usbDevices != null && usbDevices . contains ( device ) ; }
Returns true if the given package has permission to access the device .