usb: Add support for SEC specific enableUsbDataSignal path
Change-Id: Ib3cb4f90db730180d72ca4ee161906e2c0dd7383
diff --git a/hal/Usb.cpp b/hal/Usb.cpp
index d79cd1c..576e2ad 100644
--- a/hal/Usb.cpp
+++ b/hal/Usb.cpp
@@ -62,7 +62,8 @@
ALOGI("Userspace turn %s USB data signaling", enable ? "on" : "off");
if (enable) {
- if (!WriteStringToFile("1", mDevicePath + USB_DATA_PATH)) {
+ if (!WriteStringToFile("1", mDevicePath + USB_DATA_PATH) &&
+ !WriteStringToFile("OFF", USB_DATA_PATH_SEC)) {
ALOGE("Not able to turn on usb connection notification");
result = false;
}
@@ -79,7 +80,8 @@
ALOGW("Not able to set Vbus state");
}
- if (!WriteStringToFile("0", mDevicePath + USB_DATA_PATH)) {
+ if (!WriteStringToFile("0", mDevicePath + USB_DATA_PATH) &&
+ !WriteStringToFile("ON", USB_DATA_PATH_SEC)) {
ALOGE("Not able to turn off usb connection notification");
result = false;
}
diff --git a/hal/Usb.h b/hal/Usb.h
index a64197f..3a42d47 100644
--- a/hal/Usb.h
+++ b/hal/Usb.h
@@ -67,6 +67,7 @@
#define ID_PATH "id"
#define VBUS_PATH "b_sess"
#define USB_DATA_PATH "usb_data_enabled"
+#define USB_DATA_PATH_SEC "/sys/devices/virtual/usb_notify/usb_control/disable"
#define USB_CONTROLLER_PROP "vendor.usb.controller"
#define GADGET_PATH "/config/usb_gadget/g1/"