mirror of
https://github.com/Evolution-X-Devices/device_google_wahoo
synced 2026-02-01 07:50:47 +00:00
Add audio_source combinations to usb hal
This allows android auto and accessory hid to both work, and matches functionality on other device in O. Bug: 74172000 Test: auto starts Change-Id: I786cd66bed015c5ad2a4ca668f0d0fbc9c8af507
This commit is contained in:
@@ -390,6 +390,27 @@ static V1_0::Status validateAndSetVidPid(uint64_t functions) {
|
||||
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
|
||||
ret = setVidPid("0x18d1", "0x2d01");
|
||||
break;
|
||||
case static_cast<uint64_t>(GadgetFunction::AUDIO_SOURCE):
|
||||
if (!(vendorFunctions == "user" || vendorFunctions == ""))
|
||||
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
|
||||
ret = setVidPid("0x18d1", "0x2d02");
|
||||
break;
|
||||
case GadgetFunction::ADB | GadgetFunction::AUDIO_SOURCE:
|
||||
if (!(vendorFunctions == "user" || vendorFunctions == ""))
|
||||
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
|
||||
ret = setVidPid("0x18d1", "0x2d03");
|
||||
break;
|
||||
case GadgetFunction::ACCESSORY | GadgetFunction::AUDIO_SOURCE:
|
||||
if (!(vendorFunctions == "user" || vendorFunctions == ""))
|
||||
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
|
||||
ret = setVidPid("0x18d1", "0x2d04");
|
||||
break;
|
||||
case GadgetFunction::ADB | GadgetFunction::ACCESSORY |
|
||||
GadgetFunction::AUDIO_SOURCE:
|
||||
if (!(vendorFunctions == "user" || vendorFunctions == ""))
|
||||
ALOGE("Invalid vendorFunctions set: %s", vendorFunctions.c_str());
|
||||
ret = setVidPid("0x18d1", "0x2d05");
|
||||
break;
|
||||
default:
|
||||
ALOGE("Combination not supported");
|
||||
ret = Status::CONFIGURATION_NOT_SUPPORTED;
|
||||
@@ -453,6 +474,11 @@ V1_0::Status UsbGadget::setupFunctions(
|
||||
if (linkFunction("accessory.gs2", i++)) return Status::ERROR;
|
||||
}
|
||||
|
||||
if ((functions & GadgetFunction::AUDIO_SOURCE) != 0) {
|
||||
ALOGI("setCurrentUsbFunctions Audio Source");
|
||||
if (linkFunction("audio_source.gs3", i++)) return Status::ERROR;
|
||||
}
|
||||
|
||||
if ((functions & GadgetFunction::RNDIS) != 0) {
|
||||
ALOGI("setCurrentUsbFunctions rndis");
|
||||
if (linkFunction("gsi.rndis", i++)) return Status::ERROR;
|
||||
|
||||
Reference in New Issue
Block a user