• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/core


Commit MetaInfo

Révisioncea1c6248b6993565b90eb8ea3020ad851ba4e29 (tree)
l'heure2019-05-21 09:29:18
AuteurJosh Gao <jmgao@goog...>
Commiterandroid-build-merger

Message de Log

Merge "adbd: read, print, and ignore USB control transfers." into qt-dev
am: 6031286936

Change-Id: Iff482249f9442a851e2681869babc2bcb081385b

Change Summary

Modification

--- a/adb/daemon/usb.cpp
+++ b/adb/daemon/usb.cpp
@@ -364,6 +364,33 @@ struct UsbFfsConnection : public Connection {
364364 bound = false;
365365 running = false;
366366 break;
367+
368+ case FUNCTIONFS_SETUP: {
369+ LOG(INFO) << "received FUNCTIONFS_SETUP control transfer: bRequestType = "
370+ << static_cast<int>(event.u.setup.bRequestType)
371+ << ", bRequest = " << static_cast<int>(event.u.setup.bRequest)
372+ << ", wValue = " << static_cast<int>(event.u.setup.wValue)
373+ << ", wIndex = " << static_cast<int>(event.u.setup.wIndex)
374+ << ", wLength = " << static_cast<int>(event.u.setup.wLength);
375+
376+ if ((event.u.setup.bRequestType & USB_DIR_IN)) {
377+ LOG(WARNING) << "received a device-to-host control transfer, ignoring";
378+ } else {
379+ std::string buf;
380+ buf.resize(event.u.setup.wLength + 1);
381+
382+ ssize_t rc = adb_read(control_fd_.get(), buf.data(), buf.size());
383+ if (rc != event.u.setup.wLength) {
384+ LOG(ERROR)
385+ << "read " << rc
386+ << " bytes when trying to read control request, expected "
387+ << event.u.setup.wLength;
388+ }
389+
390+ LOG(INFO) << "control request contents: " << buf;
391+ break;
392+ }
393+ }
367394 }
368395 }
369396