adb: libusb: recognize devices with multiple interfaces.
A bug was introduced by commit 8bf37d7a wherein we accidentally only
look at the first interface of a device when checking whether a USB
device was an ADB device or not.
Bug: http://b/38201318
Test: none
Change-Id: I8e8e0963c77cd2cb03538d926ab735f4b57e52b7
diff --git a/adb/client/usb_libusb.cpp b/adb/client/usb_libusb.cpp
index 2508fc1..fc32469 100644
--- a/adb/client/usb_libusb.cpp
+++ b/adb/client/usb_libusb.cpp
@@ -237,7 +237,7 @@
// TODO: Is this assumption valid?
LOG(VERBOSE) << "skipping interface with incorrect num_altsetting at " << device_address
<< " (interface " << interface_num << ")";
- return;
+ continue;
}
const libusb_interface_descriptor& interface_desc = interface.altsetting[0];
@@ -245,7 +245,7 @@
interface_desc.bInterfaceProtocol)) {
LOG(VERBOSE) << "skipping non-adb interface at " << device_address << " (interface "
<< interface_num << ")";
- return;
+ continue;
}
LOG(VERBOSE) << "found potential adb interface at " << device_address << " (interface "
@@ -261,7 +261,7 @@
const uint8_t transfer_type = endpoint_attr & LIBUSB_TRANSFER_TYPE_MASK;
if (transfer_type != LIBUSB_TRANSFER_TYPE_BULK) {
- return;
+ continue;
}
if (endpoint_is_output(endpoint_addr) && !found_out) {