summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Chi <raychi@google.com>2021-04-23 14:53:44 +0800
committerRay Chi <raychi@google.com>2021-04-23 19:33:41 +0800
commitc4e6499d88fe68ccb2cfce41a1df320937b45287 (patch)
tree37b43b647a42ca6c70c595da348736eb03b71cb3
parent488ea9bd19fd6c582f00c1f55ca52d8ed0d9e5b4 (diff)
downloadredfin-c4e6499d88fe68ccb2cfce41a1df320937b45287.tar.gz
redfin: usb: add state of usb extcon to monitorffsandroid-s-beta-2android-s-beta-1
Monitorffs needs to check the state of usb extcon to pull up USB gadget. Therefore, this patch add state of usb extcon and send this information to monitorffs. Bug: 173086594 Test: verified pass Merged-In: I29df29efcf55118241f0ca7072b034c1fb5a37f2 Change-Id: I2c19f769991b014dfa7051e114abfecc40b90a6e
-rw-r--r--usb/UsbGadget.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/usb/UsbGadget.h b/usb/UsbGadget.h
index 93c7d66..32b173f 100644
--- a/usb/UsbGadget.h
+++ b/usb/UsbGadget.h
@@ -66,7 +66,8 @@ using ::android::hardware::usb::gadget::V1_1::IUsbGadget;
using ::std::string;
constexpr char kGadgetName[] = "a600000.dwc3";
-static MonitorFfs monitorFfs(kGadgetName);
+constexpr char kExtconUsbState[] = "/sys/class/extcon/extcon4/cable.0/state";
+static MonitorFfs monitorFfs(kGadgetName, kExtconUsbState);
struct UsbGadget : public IUsbGadget {
UsbGadget();