summaryrefslogtreecommitdiff
path: root/usb
diff options
context:
space:
mode:
authorRicky Niu <rickyniu@google.com>2022-03-25 14:38:33 +0800
committerTreeHugger Robot <treehugger-gerrit@google.com>2022-03-25 10:34:56 +0000
commit7d413565cd99456d37b14289f80e780d1d47395d (patch)
treea54c7bb29f0059055c749f9c98e0fc424fe846ba /usb
parent6bfa5980f97d3d55679fb77c12d7521c2c33d4e9 (diff)
downloadgs201-7d413565cd99456d37b14289f80e780d1d47395d.tar.gz
usb: Add dm condition in NCM
Add vid/pid 04e8/6862 for dm condition in NCM Test: The usb gadget functions work normally Bug: 226682477 Signed-off-by: Ricky Niu <rickyniu@google.com> Change-Id: I263f125d2ff961a6967b5b536c71fcbdcd87ed05
Diffstat (limited to 'usb')
-rw-r--r--usb/gadget/UsbGadget.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/usb/gadget/UsbGadget.cpp b/usb/gadget/UsbGadget.cpp
index 9fdf2ac..2a1e16c 100644
--- a/usb/gadget/UsbGadget.cpp
+++ b/usb/gadget/UsbGadget.cpp
@@ -270,9 +270,13 @@ static V1_0::Status validateAndSetVidPid(uint64_t functions) {
ret = setVidPid("0x18d1", "0x4eeb");
break;
case GadgetFunction::ADB | GadgetFunction::NCM:
- if (!(vendorFunctions == "user" || vendorFunctions == ""))
- ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
- ret = setVidPid("0x18d1", "0x4eec");
+ if (vendorFunctions == "dm") {
+ ret = setVidPid("0x04e8", "0x6862");
+ } else {
+ if (!(vendorFunctions == "user" || vendorFunctions == ""))
+ ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
+ ret = setVidPid("0x18d1", "0x4eec");
+ }
break;
default:
ALOGE("Combination not supported");