MCPcopy Create free account
hub / github.com/XCSoar/XCSoar / UsbSerialHelper

Method UsbSerialHelper

android/src/UsbSerialHelper.java:350–363  ·  view source on GitHub ↗
(Context context)

Source from the content-addressed store, hash-verified

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();

Callers

nothing calls this directly

Calls 2

addAvailableMethod · 0.95
registerReceiverMethod · 0.95

Tested by

no test coverage detected