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

Commit 7203cca7 authored by yidongh's avatar yidongh
Browse files

hal: remove connection check for a2dp suspend state update

When a2dp is connected during call, BT framework will set
"A2dpSuspended=true" to audio HAL, but it may not be handled
as sometimes a2dp has not been connected in audio side. Thus
when a2dp connected, a2dp suspend state in HAL is different
with BT side, causing unnecessary audio_check_a2dp_ready calls.

Do not check a2dp connection state in HAL when handling a2dp
suspend state change from upper layer.

CRs-Fixed: 2310792
Change-Id: Iab1cc03433d432ea96b5e96bbcd267f06cce637b
parent 0dd741a1
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -1877,10 +1877,12 @@ void audio_extn_a2dp_set_parameters(struct str_parms *parms)


     ret = str_parms_get_str(parms, "A2dpSuspended", value, sizeof(value));
     ret = str_parms_get_str(parms, "A2dpSuspended", value, sizeof(value));
     if (ret >= 0) {
     if (ret >= 0) {
         if (a2dp.bt_lib_handle && (a2dp.bt_state != A2DP_STATE_DISCONNECTED) ) {
         if (a2dp.bt_lib_handle) {
             if ((!strncmp(value,"true",sizeof(value)))) {
             if ((!strncmp(value,"true",sizeof(value)))) {
                ALOGD("Setting a2dp to suspend state");
                ALOGD("Setting a2dp to suspend state");
                a2dp.a2dp_suspended = true;
                a2dp.a2dp_suspended = true;
                if (a2dp.bt_state == A2DP_STATE_DISCONNECTED)
                    goto param_handled;
                list_for_each(node, &a2dp.adev->usecase_list) {
                list_for_each(node, &a2dp.adev->usecase_list) {
                    uc_info = node_to_item(node, struct audio_usecase, list);
                    uc_info = node_to_item(node, struct audio_usecase, list);
                    if (uc_info->type == PCM_PLAYBACK &&
                    if (uc_info->type == PCM_PLAYBACK &&