Merge 550adf5f8d5ac08fa0f9fd627baaf7f1b830b807 on remote branch

Change-Id: I4262173acb474a7be58b687e04a1235036d11e92
diff --git a/etc/init.qcom.usb.rc b/etc/init.qcom.usb.rc
index c4932c1..98cdf67 100644
--- a/etc/init.qcom.usb.rc
+++ b/etc/init.qcom.usb.rc
@@ -26,6 +26,35 @@
 # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
 
+# Changes from Qualcomm Innovation Center are provided under the following license:
+# Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above
+#       copyright notice, this list of conditions and the following
+#       disclaimer in the documentation and/or other materials provided
+#       with the distribution.
+#     * Neither the name of The Linux Foundation nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
 on charger
     mount configfs none /config
     mkdir /config/usb_gadget/g1 0770
@@ -44,7 +73,7 @@
     wait /sys/class/udc/${sys.usb.controller}
     setprop sys.usb.configfs 1
 
-on post-fs
+on post-fs-data
     mount configfs none /config
     mkdir /config/usb_gadget/g1 0770
     mkdir /config/usb_gadget/g2 0770
@@ -111,7 +140,7 @@
     write /config/usb_gadget/g1/strings/0x409/product ${vendor.usb.product_string}
     write /config/usb_gadget/g2/strings/0x409/product ${vendor.usb.product_string}
 
-on post-fs && property:vendor.usb.use_ffs_mtp=1
+on post-fs-data && property:vendor.usb.use_ffs_mtp=1
    mkdir /config/usb_gadget/g1/functions/ffs.mtp
    mkdir /config/usb_gadget/g1/functions/ffs.ptp
    mkdir /dev/usb-ffs/mtp 0770 mtp mtp
diff --git a/etc/init.qti.usb.debug.sh b/etc/init.qti.usb.debug.sh
index fa2f7ef..09b5a4c 100644
--- a/etc/init.qti.usb.debug.sh
+++ b/etc/init.qti.usb.debug.sh
@@ -113,5 +113,10 @@
     # usb instance kprobe events
     echo 1 > events/usb_gadget/enable
 
+    #DWC3 core runtime
+    echo 'name~"a600000.*"' > events/rpm/filter
+    echo 1 > events/rpm/rpm_resume/enable
+    echo 1 > events/rpm/rpm_suspend/enable
+    echo 1 > events/rpm/rpm_return_int/enable
     echo 1 > tracing_on
 fi
diff --git a/hal/UsbGadget.cpp b/hal/UsbGadget.cpp
index 65a8c09..1ab603d 100644
--- a/hal/UsbGadget.cpp
+++ b/hal/UsbGadget.cpp
@@ -241,7 +241,7 @@
   V1_0::Status ret = Status::SUCCESS;
   switch (functions) {
     case static_cast<uint64_t>(GadgetFunction::ADB):
-      ret = setVidPid("0x18d1", "0x4ee7");
+      ret = setVidPid("0x18d1", "0x4e11");
       break;
     case static_cast<uint64_t>(GadgetFunction::MTP):
       ret = setVidPid("0x18d1", "0x4ee1");