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

Commit e7f0ea79 authored by Cheney Ni's avatar Cheney Ni Committed by android-build-team Robot
Browse files

Reland BluetoothAudio HAL: flip to be enabled by default

Check property to know whether BluetoothAudio is disabled or not, and
use old bthost_ipc when disabled.

Bug: 126304229
Test: Switch BluetoothAudio HAL and A2DP offload manully
(cherry picked from commit 409f07c0)

Change-Id: I96dcd64ff26a4d95dc55389f6db16c12d32b3280
(cherry picked from commit 7451e9b8)
parent 2073167c
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -79,7 +79,7 @@
// System properties used for A2DP Offload
// System properties used for A2DP Offload
#define SYSPROP_A2DP_OFFLOAD_SUPPORTED "ro.bluetooth.a2dp_offload.supported"
#define SYSPROP_A2DP_OFFLOAD_SUPPORTED "ro.bluetooth.a2dp_offload.supported"
#define SYSPROP_A2DP_OFFLOAD_DISABLED  "persist.bluetooth.a2dp_offload.disabled"
#define SYSPROP_A2DP_OFFLOAD_DISABLED  "persist.bluetooth.a2dp_offload.disabled"
#define SYSPROP_BLUETOOTH_AUDIO_HAL_ENABLED  "persist.vendor.bluetooth.bluetooth_audio_hal.enabled"
#define SYSPROP_BLUETOOTH_AUDIO_HAL_DISABLED  "persist.vendor.bluetooth.bluetooth_audio_hal.disabled"
#define SYSPROP_A2DP_CODEC_LATENCIES   "vendor.audio.a2dp.codec.latency"
#define SYSPROP_A2DP_CODEC_LATENCIES   "vendor.audio.a2dp.codec.latency"


// Default encoder bit width
// Default encoder bit width
@@ -680,7 +680,7 @@ static int open_a2dp_output()
    int ret = 0;
    int ret = 0;
    ALOGD("%s: Open A2DP output start", __func__);
    ALOGD("%s: Open A2DP output start", __func__);
    bool hal_v2_enabled =
    bool hal_v2_enabled =
              property_get_bool(SYSPROP_BLUETOOTH_AUDIO_HAL_ENABLED, false);
              !property_get_bool(SYSPROP_BLUETOOTH_AUDIO_HAL_DISABLED, false);


    if (a2dp.bt_state != A2DP_STATE_DISCONNECTED) {
    if (a2dp.bt_state != A2DP_STATE_DISCONNECTED) {
        ALOGD("%s: Called A2DP open with improper state, Ignoring request state %d",
        ALOGD("%s: Called A2DP open with improper state, Ignoring request state %d",