(Context context)
| 348 | } |
| 349 | |
| 350 | private UsbSerialHelper(Context context) throws IOException { |
| 351 | this.context = context; |
| 352 | |
| 353 | usbmanager = (UsbManager) context.getSystemService(Context.USB_SERVICE); |
| 354 | if (usbmanager == null) |
| 355 | throw new IOException("No USB service"); |
| 356 | |
| 357 | HashMap<String, UsbDevice> devices = usbmanager.getDeviceList(); |
| 358 | for (Map.Entry<String, UsbDevice> entry : devices.entrySet()) { |
| 359 | addAvailable(entry.getValue()); |
| 360 | } |
| 361 | |
| 362 | registerReceiver(); |
| 363 | } |
| 364 | |
| 365 | private void close() { |
| 366 | unregisterReceiver(); |
nothing calls this directly
no test coverage detected