summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Gao2017-05-12 17:12:32 -0500
committerJosh Gao2017-05-12 19:08:50 -0500
commit425aefdcf0f1b2068f56ca091047af5f02ae3f3d (patch)
tree6aafee73cb263b5412b05729e9d40607a2d50d92
parent3f60a968e35b051943249fb9ac70e349323a0590 (diff)
downloadplatform-system-core-425aefdcf0f1b2068f56ca091047af5f02ae3f3d.tar.gz
platform-system-core-425aefdcf0f1b2068f56ca091047af5f02ae3f3d.tar.xz
platform-system-core-425aefdcf0f1b2068f56ca091047af5f02ae3f3d.zip
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
-rw-r--r--adb/client/usb_libusb.cpp6
1 files 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) {
237 // TODO: Is this assumption valid? 237 // TODO: Is this assumption valid?
238 LOG(VERBOSE) << "skipping interface with incorrect num_altsetting at " << device_address 238 LOG(VERBOSE) << "skipping interface with incorrect num_altsetting at " << device_address
239 << " (interface " << interface_num << ")"; 239 << " (interface " << interface_num << ")";
240 return; 240 continue;
241 } 241 }
242 242
243 const libusb_interface_descriptor& interface_desc = interface.altsetting[0]; 243 const libusb_interface_descriptor& interface_desc = interface.altsetting[0];
@@ -245,7 +245,7 @@ static void process_device(libusb_device* device) {
245 interface_desc.bInterfaceProtocol)) { 245 interface_desc.bInterfaceProtocol)) {
246 LOG(VERBOSE) << "skipping non-adb interface at " << device_address << " (interface " 246 LOG(VERBOSE) << "skipping non-adb interface at " << device_address << " (interface "
247 << interface_num << ")"; 247 << interface_num << ")";
248 return; 248 continue;
249 } 249 }
250 250
251 LOG(VERBOSE) << "found potential adb interface at " << device_address << " (interface " 251 LOG(VERBOSE) << "found potential adb interface at " << device_address << " (interface "
@@ -261,7 +261,7 @@ static void process_device(libusb_device* device) {
261 const uint8_t transfer_type = endpoint_attr & LIBUSB_TRANSFER_TYPE_MASK; 261 const uint8_t transfer_type = endpoint_attr & LIBUSB_TRANSFER_TYPE_MASK;
262 262
263 if (transfer_type != LIBUSB_TRANSFER_TYPE_BULK) { 263 if (transfer_type != LIBUSB_TRANSFER_TYPE_BULK) {
264 return; 264 continue;
265 } 265 }
266 266
267 if (endpoint_is_output(endpoint_addr) && !found_out) { 267 if (endpoint_is_output(endpoint_addr) && !found_out) {