Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6851adba authored by Cheney Ni's avatar Cheney Ni Committed by Hansong Zhang
Browse files

Introduce a new Audio HW module: bluetooth_audio

When persist.bluetooth.bluetooth_audio_hal.enabled is true, the audio
server will load audio_policy_configuration_bluetooth_hal_enabled.xml
to enable BluetoothAudio HAL 2.0

Bug: 111519504
Bug: 121411420
Bug: 122556667
Test: manual

Change-Id: I52df919be8525aa58384163e9505c02a52773506
parent 4ae8b0c3
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -33,6 +33,8 @@
#define AUDIO_POLICY_XML_CONFIG_FILE_NAME "audio_policy_configuration.xml"
#define AUDIO_POLICY_A2DP_OFFLOAD_DISABLED_XML_CONFIG_FILE_NAME \
        "audio_policy_configuration_a2dp_offload_disabled.xml"
#define AUDIO_POLICY_BLUETOOTH_HAL_ENABLED_XML_CONFIG_FILE_NAME \
        "audio_policy_configuration_bluetooth_hal_enabled.xml"

#include <inttypes.h>
#include <math.h>
@@ -3908,8 +3910,12 @@ static status_t deserializeAudioPolicyXmlConfig(AudioPolicyConfig &config) {
    if (property_get_bool("ro.bluetooth.a2dp_offload.supported", false) &&
        property_get_bool("persist.bluetooth.a2dp_offload.disabled", false)) {
        // A2DP offload supported but disabled: try to use special XML file
        if (property_get_bool("persist.bluetooth.bluetooth_audio_hal.enabled", false)) {
            fileNames.push_back(AUDIO_POLICY_BLUETOOTH_HAL_ENABLED_XML_CONFIG_FILE_NAME);
        } else {
            fileNames.push_back(AUDIO_POLICY_A2DP_OFFLOAD_DISABLED_XML_CONFIG_FILE_NAME);
        }
    }
    fileNames.push_back(AUDIO_POLICY_XML_CONFIG_FILE_NAME);

    for (const char* fileName : fileNames) {