From af086e9a95cb52cdc7432c58e221ab86fafed87a Mon Sep 17 00:00:00 2001 From: Josh Gao Date: Tue, 21 May 2019 16:07:03 -0700 Subject: [PATCH] adbd: respond to device-to-host control transfers. Failing to write to the endpoint results in subsequent reads on ep0 to fail with EL2HLT, so do an empty write to fulfill the transfer. Bug: http://b/131867920 Test: manually tested with modified auto client Change-Id: If2eec162ca4b31a9974c7bd5802be51cee9e2708 --- adb/daemon/usb.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/adb/daemon/usb.cpp b/adb/daemon/usb.cpp index 806ed8cf8..1abae87c5 100644 --- a/adb/daemon/usb.cpp +++ b/adb/daemon/usb.cpp @@ -380,7 +380,12 @@ struct UsbFfsConnection : public Connection { << ", wLength = " << static_cast(event.u.setup.wLength); if ((event.u.setup.bRequestType & USB_DIR_IN)) { - LOG(WARNING) << "received a device-to-host control transfer, ignoring"; + LOG(INFO) << "acking device-to-host control transfer"; + ssize_t rc = adb_write(control_fd_.get(), "", 0); + if (rc != 0) { + PLOG(ERROR) << "failed to write empty packet to host"; + break; + } } else { std::string buf; buf.resize(event.u.setup.wLength + 1);