use of android.hardware.usb.UsbPort in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class UsbBackend method updatePorts.
private void updatePorts() {
mPort = null;
mPortStatus = null;
List<UsbPort> ports = mUsbManager.getPorts();
// For now look for a connected port, in the future we should identify port in the
// notification and pick based on that.
final int N = ports.size();
for (int i = 0; i < N; i++) {
UsbPortStatus status = ports.get(i).getStatus();
if (status.isConnected()) {
mPort = ports.get(i);
mPortStatus = status;
break;
}
}
}
Aggregations