diff --git a/frameworks/av/0001-APM-Restore-S-R-and-Q-behavior-respectively-for-tele.patch b/frameworks/av/0001-APM-Restore-S-R-and-Q-behavior-respectively-for-tele.patch index dd4422c..7cfcb67 100644 --- a/frameworks/av/0001-APM-Restore-S-R-and-Q-behavior-respectively-for-tele.patch +++ b/frameworks/av/0001-APM-Restore-S-R-and-Q-behavior-respectively-for-tele.patch @@ -1,7 +1,7 @@ From 51deb8e31ca57f19420277cc92b26375233e9050 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Thu, 18 Aug 2022 15:44:46 -0400 -Subject: [PATCH 1/2] APM: Restore S, R and Q behavior respectively for +Subject: [PATCH 1/3] APM: Restore S, R and Q behavior respectively for telephony audio This conditionally reverts part of b2e5cb (T), 51c9cc (S) and afd4ce (R) diff --git a/frameworks/av/0002-APM-Optionally-force-load-audio-policy-for-system-si.patch b/frameworks/av/0002-APM-Optionally-force-load-audio-policy-for-system-si.patch index 072d60e..4462b0d 100644 --- a/frameworks/av/0002-APM-Optionally-force-load-audio-policy-for-system-si.patch +++ b/frameworks/av/0002-APM-Optionally-force-load-audio-policy-for-system-si.patch @@ -1,7 +1,7 @@ From 5def9ad1a26e28d517666e34301dc725c1660e36 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Wed, 24 Aug 2022 15:42:39 -0400 -Subject: [PATCH 2/2] APM: Optionally force-load audio policy for system-side +Subject: [PATCH 2/3] APM: Optionally force-load audio policy for system-side bt audio HAL Required to support our system-side bt audio implementation, i.e. diff --git a/frameworks/av/0003-APM-Remove-A2DP-audio-ports-from-the-primary-HAL.patch b/frameworks/av/0003-APM-Remove-A2DP-audio-ports-from-the-primary-HAL.patch new file mode 100644 index 0000000..07b962b --- /dev/null +++ b/frameworks/av/0003-APM-Remove-A2DP-audio-ports-from-the-primary-HAL.patch @@ -0,0 +1,79 @@ +From e31fc6f3f79848e6f7e7b1b4abe82aa26571cf7b Mon Sep 17 00:00:00 2001 +From: Peter Cai +Date: Thu, 25 Aug 2022 13:30:29 -0400 +Subject: [PATCH 3/3] APM: Remove A2DP audio ports from the primary HAL + +These ports defined in the primary HAL are intended for A2DP offloading, +however they do not work in general on GSIs, and will interfere with +sysbta, the system-side generic bluetooth audio implementation. + +Remove them as we parse the policy XML. + +Co-authored-by: Pierre-Hugues Husson +Change-Id: I3305594a17285da113167b419543543f0ef71122 +--- + .../managerdefinitions/src/Serializer.cpp | 26 ++++++++++++++++--- + 1 file changed, 22 insertions(+), 4 deletions(-) + +diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp +index f5233f2a42..6630d06f6d 100644 +--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp ++++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -334,11 +335,8 @@ status_t PolicySerializer::deserializeCollection(const xmlNode *cur, + Trait::collectionTag); + return status; + } +- } else if (mIgnoreVendorExtensions && std::get(maybeElement) == NO_INIT) { +- // Skip a vendor extension element. +- } else { +- return BAD_VALUE; + } ++ // Ignore elements that failed to parse, e.g. routes with invalid sinks + } + } + if (!xmlStrcmp(cur->name, reinterpret_cast(Trait::tag))) { +@@ -679,6 +677,7 @@ std::variant PolicySerializer::deserialize PolicySerializer::deserializetype(); ++ if (type == AUDIO_DEVICE_OUT_BLUETOOTH_A2DP ++ || type == AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES ++ || type == AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER) { ++ ALOGE("Erasing A2DP device port %s", port->getTagName().c_str()); ++ iter = devicePorts.erase(iter); ++ } else { ++ iter++; ++ } ++ } ++ } + module->setDeclaredDevices(devicePorts); + + RouteTraits::Collection routes; +-- +2.37.2 +