From 425aefdcf0f1b2068f56ca091047af5f02ae3f3d Mon Sep 17 00:00:00 2001 From: Josh Gao Date: Fri, 12 May 2017 15:12:32 -0700 Subject: [PATCH] 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 --- adb/client/usb_libusb.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/adb/client/usb_libusb.cpp b/adb/client/usb_libusb.cpp index 2508fc12e..fc32469fa 100644 --- a/adb/client/usb_libusb.cpp +++ b/adb/client/usb_libusb.cpp @@ -237,7 +237,7 @@ static void process_device(libusb_device* device) { // 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 @@ static void process_device(libusb_device* device) { 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 @@ static void process_device(libusb_device* device) { 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) {