summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Chi <raychi@google.com>2021-04-23 14:49:48 +0800
committerRay Chi <raychi@google.com>2021-04-23 14:49:48 +0800
commit76abcff08593c8ff581aea1355bae519912c85d2 (patch)
tree3b9a5b8200ddee2f66cbe4992cbe959308f9046b
parent4f911c1b426d4f1e289a5ca00c0826c138d53baf (diff)
downloadbramble-76abcff08593c8ff581aea1355bae519912c85d2.tar.gz
bramble: usb: add state of usb extcon to monitorffs
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 Change-Id: I2996e4e9659af894931e0e4300d32143b6594667
-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();