usb: Add dm condition in NCM
Add vid/pid 04e8/6862 for dm condition in NCM
Test: The usb gadget functions work normally
Bug: 206565428
Signed-off-by: Ricky Niu <rickyniu@google.com>
Change-Id: I04fba9fc137848d7f1c97a288bb12d76a613badc
diff --git a/usb/UsbGadget.cpp b/usb/UsbGadget.cpp
index 0a6cea3..5c0021f 100644
--- a/usb/UsbGadget.cpp
+++ b/usb/UsbGadget.cpp
@@ -228,9 +228,13 @@
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");