From d506dac0a02020faf7d689e50c1350f529d52c08 Mon Sep 17 00:00:00 2001 From: Josh Gao Date: Wed, 17 Oct 2018 13:14:57 -0700 Subject: [PATCH] adbd: open functionfs ep0 as O_RDWR. We need to read from ep0 to poll for events. Test: test_device.py Change-Id: I59602c20f5dfdb17bfbab13d3033e9333a51caf3 --- adb/daemon/usb_ffs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adb/daemon/usb_ffs.cpp b/adb/daemon/usb_ffs.cpp index 89348c29c..07b4ba898 100644 --- a/adb/daemon/usb_ffs.cpp +++ b/adb/daemon/usb_ffs.cpp @@ -230,7 +230,7 @@ bool open_functionfs(android::base::unique_fd* out_control, android::base::uniqu if (out_control->get() < 0) { // might have already done this before LOG(INFO) << "opening control endpoint " << USB_FFS_ADB_EP0; - control.reset(adb_open(USB_FFS_ADB_EP0, O_WRONLY)); + control.reset(adb_open(USB_FFS_ADB_EP0, O_RDWR)); if (control < 0) { PLOG(ERROR) << "cannot open control endpoint " << USB_FFS_ADB_EP0; return false;