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..25fd781 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,8 +1,8 @@ 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 - telephony audio +Subject: [PATCH] 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. 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 deleted file mode 100644 index 072d60e..0000000 --- a/frameworks/av/0002-APM-Optionally-force-load-audio-policy-for-system-si.patch +++ /dev/null @@ -1,61 +0,0 @@ -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 - bt audio HAL - -Required to support our system-side bt audio implementation, i.e. -`sysbta`. - -Co-authored-by: Pierre-Hugues Husson -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 - #include - #include -+#include - #include - #include - #include -@@ -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(root, config); -+ modules.add(std::get<1>(maybeA2dpModule)); -+ } -+ - config->setHwModules(modules); - - // Global Configuration --- -2.37.2 - diff --git a/packages/modules/Bluetooth/0001-Additionally-check-le_set_event_mask-command-resturn.patch b/packages/modules/Bluetooth/0001-Additionally-check-le_set_event_mask-command-resturn.patch index 6a9d50c..77ca9a4 100644 --- a/packages/modules/Bluetooth/0001-Additionally-check-le_set_event_mask-command-resturn.patch +++ b/packages/modules/Bluetooth/0001-Additionally-check-le_set_event_mask-command-resturn.patch @@ -1,8 +1,8 @@ From a1d10cb31ae386c01a66c8bf0a028b8f33e5bd32 Mon Sep 17 00:00:00 2001 From: "tzu-hsien.huang" Date: Wed, 20 Jul 2022 15:12:01 +0800 -Subject: [PATCH 1/3] Additionally check le_set_event_mask command resturn - status with UNSUPPORTED_LMP_OR_LL_PARAMETER +Subject: [PATCH] Additionally check le_set_event_mask command resturn status + with UNSUPPORTED_LMP_OR_LL_PARAMETER MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/packages/modules/Bluetooth/0002-gd-hci-Ignore-unexpected-status-events.patch b/packages/modules/Bluetooth/0002-gd-hci-Ignore-unexpected-status-events.patch deleted file mode 100644 index 79d9f44..0000000 --- a/packages/modules/Bluetooth/0002-gd-hci-Ignore-unexpected-status-events.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 0e2bf3f3d46efaa7d01d3554b7e5ceeac9664c69 Mon Sep 17 00:00:00 2001 -From: Peter Cai -Date: Wed, 24 Aug 2022 10:41:29 -0400 -Subject: [PATCH 2/3] gd: hci: Ignore unexpected status events - -For some reason, on some old devices, the controller will report a -remote to support SNIFF_SUBRATING even when it does not. Just ignore the -error here (the status event comes from the failure response). - -Change-Id: Ifb9a65fd77f21d15a8dc1ced9240194d38218ef6 ---- - system/gd/hci/hci_layer.cc | 15 +++++++-------- - 1 file changed, 7 insertions(+), 8 deletions(-) - -diff --git a/system/gd/hci/hci_layer.cc b/system/gd/hci/hci_layer.cc -index 57d7e55fff..b5a9d065be 100644 ---- a/system/gd/hci/hci_layer.cc -+++ b/system/gd/hci/hci_layer.cc -@@ -195,14 +195,13 @@ struct HciLayer::impl { - EventView::Create(PacketView(std::make_shared>(std::vector())))); - command_queue_.front().GetCallback()->Invoke(move(command_complete_view)); - } else { -- ASSERT_LOG( -- command_queue_.front().waiting_for_status_ == is_status, -- "0x%02hx (%s) was not expecting %s event", -- op_code, -- OpCodeText(op_code).c_str(), -- logging_id.c_str()); -- -- command_queue_.front().GetCallback()->Invoke(move(response_view)); -+ if (command_queue_.front().waiting_for_status_ == is_status) { -+ command_queue_.front().GetCallback()->Invoke(move(response_view)); -+ } else { -+ CommandCompleteView command_complete_view = CommandCompleteView::Create( -+ EventView::Create(PacketView(std::make_shared>(std::vector())))); -+ command_queue_.front().GetCallback()->Invoke(move(command_complete_view)); -+ } - } - - command_queue_.pop_front(); --- -2.37.2 - diff --git a/packages/modules/Bluetooth/0003-audio_hal_interface-Optionally-use-sysbta-HAL.patch b/packages/modules/Bluetooth/0003-audio_hal_interface-Optionally-use-sysbta-HAL.patch deleted file mode 100644 index 9bb89ee..0000000 --- a/packages/modules/Bluetooth/0003-audio_hal_interface-Optionally-use-sysbta-HAL.patch +++ /dev/null @@ -1,107 +0,0 @@ -From cad9f7f7aeaf57e5fead759bcc68b75262ba3708 Mon Sep 17 00:00:00 2001 -From: Peter Cai -Date: Wed, 24 Aug 2022 15:45:18 -0400 -Subject: [PATCH 3/3] audio_hal_interface: Optionally use sysbta HAL - -Required to support sysbta, our system-side bt audio implementation. - -Change-Id: I59973e6ec84c5923be8a7c67b36b2e237f000860 ---- - system/audio_hal_interface/aidl/client_interface_aidl.cc | 6 +++--- - system/audio_hal_interface/aidl/client_interface_aidl.h | 7 +++++++ - system/audio_hal_interface/hal_version_manager.cc | 9 ++++++++- - 3 files changed, 18 insertions(+), 4 deletions(-) - -diff --git a/system/audio_hal_interface/aidl/client_interface_aidl.cc b/system/audio_hal_interface/aidl/client_interface_aidl.cc -index 814c6c7796..a38b6da495 100644 ---- a/system/audio_hal_interface/aidl/client_interface_aidl.cc -+++ b/system/audio_hal_interface/aidl/client_interface_aidl.cc -@@ -55,7 +55,7 @@ BluetoothAudioClientInterface::BluetoothAudioClientInterface( - - bool BluetoothAudioClientInterface::is_aidl_available() { - auto service = AServiceManager_checkService( -- kDefaultAudioProviderFactoryInterface.c_str()); -+ audioProviderFactoryInterface().c_str()); - return (service != nullptr); - } - -@@ -72,7 +72,7 @@ BluetoothAudioClientInterface::GetAudioCapabilities(SessionType session_type) { - } - auto provider_factory = IBluetoothAudioProviderFactory::fromBinder( - ::ndk::SpAIBinder(AServiceManager_getService( -- kDefaultAudioProviderFactoryInterface.c_str()))); -+ audioProviderFactoryInterface().c_str()))); - - if (provider_factory == nullptr) { - LOG(ERROR) << __func__ << ", can't get capability from unknown factory"; -@@ -100,7 +100,7 @@ void BluetoothAudioClientInterface::FetchAudioProvider() { - } - auto provider_factory = IBluetoothAudioProviderFactory::fromBinder( - ::ndk::SpAIBinder(AServiceManager_getService( -- kDefaultAudioProviderFactoryInterface.c_str()))); -+ audioProviderFactoryInterface().c_str()))); - - if (provider_factory == nullptr) { - LOG(ERROR) << __func__ << ", can't get capability from unknown factory"; -diff --git a/system/audio_hal_interface/aidl/client_interface_aidl.h b/system/audio_hal_interface/aidl/client_interface_aidl.h -index 87dd450997..36d5fa5e86 100644 ---- a/system/audio_hal_interface/aidl/client_interface_aidl.h -+++ b/system/audio_hal_interface/aidl/client_interface_aidl.h -@@ -28,6 +28,7 @@ - #include "bluetooth_audio_port_impl.h" - #include "common/message_loop_thread.h" - #include "transport_instance.h" -+#include "osi/include/properties.h" - - #define BLUETOOTH_AUDIO_HAL_PROP_DISABLED \ - "persist.bluetooth.bluetooth_audio_hal.disabled" -@@ -115,6 +116,12 @@ class BluetoothAudioClientInterface { - // "android.hardware.bluetooth.audio.IBluetoothAudioProviderFactory/default"; - static inline const std::string kDefaultAudioProviderFactoryInterface = - std::string() + IBluetoothAudioProviderFactory::descriptor + "/default"; -+ static inline const std::string kSystemAudioProviderFactoryInterface = -+ std::string() + IBluetoothAudioProviderFactory::descriptor + "/sysbta"; -+ static inline const std::string audioProviderFactoryInterface() { -+ return osi_property_get_bool("persist.bluetooth.system_audio_hal.enabled", false) -+ ? kSystemAudioProviderFactoryInterface : kDefaultAudioProviderFactoryInterface; -+ } - - private: - IBluetoothTransportInstance* transport_; -diff --git a/system/audio_hal_interface/hal_version_manager.cc b/system/audio_hal_interface/hal_version_manager.cc -index a2c192f37d..c3d1cf35c2 100644 ---- a/system/audio_hal_interface/hal_version_manager.cc -+++ b/system/audio_hal_interface/hal_version_manager.cc -@@ -24,6 +24,7 @@ - #include - - #include "aidl/audio_aidl_interfaces.h" -+#include "osi/include/properties.h" - - namespace bluetooth { - namespace audio { -@@ -33,6 +34,12 @@ using ::aidl::android::hardware::bluetooth::audio:: - - static const std::string kDefaultAudioProviderFactoryInterface = - std::string() + IBluetoothAudioProviderFactory::descriptor + "/default"; -+static const std::string kSystemAudioProviderFactoryInterface = -+ std::string() + IBluetoothAudioProviderFactory::descriptor + "/sysbta"; -+static inline const std::string audioProviderFactoryInterface() { -+ return osi_property_get_bool("persist.bluetooth.system_audio_hal.enabled", false) -+ ? kSystemAudioProviderFactoryInterface : kDefaultAudioProviderFactoryInterface; -+} - - std::unique_ptr HalVersionManager::instance_ptr = - std::make_unique(); -@@ -92,7 +99,7 @@ HalVersionManager::GetProvidersFactory_2_0() { - - HalVersionManager::HalVersionManager() { - if (AServiceManager_checkService( -- kDefaultAudioProviderFactoryInterface.c_str()) != nullptr) { -+ audioProviderFactoryInterface().c_str()) != nullptr) { - hal_version_ = BluetoothAudioHalVersion::VERSION_AIDL_V1; - return; - } --- -2.37.2 -