Add frameworks/av patch for sysbta
This commit is contained in:
parent
3f7132d419
commit
eb36040ef9
|
@ -1,8 +1,8 @@
|
|||
From 51deb8e31ca57f19420277cc92b26375233e9050 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Cai <peter@typeblog.net>
|
||||
Date: Thu, 18 Aug 2022 15:44:46 -0400
|
||||
Subject: [PATCH] APM: Restore S, R and Q behavior respectively for telephony
|
||||
audio
|
||||
Subject: [PATCH 1/2] APM: Restore S, R and Q behavior respectively for
|
||||
telephony audio
|
||||
|
||||
This conditionally reverts part of b2e5cb (T), 51c9cc (S) and afd4ce (R)
|
||||
when the VNDK version is equal to or before S, R and Q respectively.
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
From 5def9ad1a26e28d517666e34301dc725c1660e36 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Cai <peter@typeblog.net>
|
||||
Date: Wed, 24 Aug 2022 15:42:39 -0400
|
||||
Subject: [PATCH 2/2] APM: Optionally force-load audio policy for system-side
|
||||
bt audio HAL
|
||||
|
||||
Required to support our system-side bt audio implementation, i.e.
|
||||
`sysbta`.
|
||||
|
||||
Co-authored-by: Pierre-Hugues Husson <phh@phh.me>
|
||||
Change-Id: I279fff541a531f922f3fa55b8f14d00237db59ff
|
||||
---
|
||||
.../managerdefinitions/src/Serializer.cpp | 25 +++++++++++++++++++
|
||||
1 file changed, 25 insertions(+)
|
||||
|
||||
diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||
index d446e9667b..f5233f2a42 100644
|
||||
--- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||
+++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/xinclude.h>
|
||||
#include <media/convert.h>
|
||||
+#include <cutils/properties.h>
|
||||
#include <utils/Log.h>
|
||||
#include <utils/StrongPointer.h>
|
||||
#include <utils/Errors.h>
|
||||
@@ -890,6 +891,30 @@ status_t PolicySerializer::deserialize(const char *configFile, AudioPolicyConfig
|
||||
if (status != NO_ERROR) {
|
||||
return status;
|
||||
}
|
||||
+
|
||||
+ // Remove modules called bluetooth, bluetooth_qti or a2dp, and inject our own
|
||||
+ if (property_get_bool("persist.bluetooth.system_audio_hal.enabled", false)) {
|
||||
+ for (auto it = modules.begin(); it != modules.end(); it++) {
|
||||
+ const char *name = (*it)->getName();
|
||||
+ if (strcmp(name, "a2dp") == 0 ||
|
||||
+ strcmp(name, "a2dpsink") == 0 ||
|
||||
+ strcmp(name, "bluetooth") == 0 ||
|
||||
+ strcmp(name, "bluetooth_qti") == 0) {
|
||||
+
|
||||
+ ALOGE("Removed module %s\n", name);
|
||||
+ it = modules.erase(it);
|
||||
+ }
|
||||
+ if (it == modules.end()) break;
|
||||
+ }
|
||||
+ const char* a2dpFileName = "/system/etc/sysbta_audio_policy_configuration.xml";
|
||||
+ if (version == "7.0")
|
||||
+ a2dpFileName = "/system/etc/sysbta_audio_policy_configuration_7_0.xml";
|
||||
+ auto doc = make_xmlUnique(xmlParseFile(a2dpFileName));
|
||||
+ xmlNodePtr root = xmlDocGetRootElement(doc.get());
|
||||
+ auto maybeA2dpModule = deserialize<ModuleTraits>(root, config);
|
||||
+ modules.add(std::get<1>(maybeA2dpModule));
|
||||
+ }
|
||||
+
|
||||
config->setHwModules(modules);
|
||||
|
||||
// Global Configuration
|
||||
--
|
||||
2.37.2
|
||||
|
Loading…
Reference in a new issue