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

Commit 30fe8683 authored by Aniket Kumar Lata's avatar Aniket Kumar Lata Committed by Ted
Browse files

hal: Reset slimbus backend config on A2DP disconnect

This change resets slimbus backend config when A2DP is
disconnected. Existing code relies on stop stream from
framework to reset A2DP backend. Disconnect event coming
before stop stream resets active sessions and hence on
subsequent stop stream, backend config is not reset to
8KHZ. This leads to problems with non-wideband SCO sinks.

Bug: 112342177
Test: Manual MO call test with BMW car kit

Change-Id: I47005be97cb1d6eed1682993532dcc80017066ab
(cherry picked from commit 91c09872640f867da8b0527eaed581557ba9935d)
parent e8ff4eb8
Loading
Loading
Loading
Loading
+1 −4
Original line number Original line Diff line number Diff line
@@ -748,8 +748,6 @@ static int close_a2dp_output()
        if (a2dp.audio_stream_close() == false)
        if (a2dp.audio_stream_close() == false)
            ALOGE("%s: failed close A2DP control path from Bluetooth IPC library", __func__);
            ALOGE("%s: failed close A2DP control path from Bluetooth IPC library", __func__);
    }
    }
    if (a2dp.abr_config.is_abr_enabled && a2dp.abr_config.abr_started)
        stop_abr();
    a2dp_common_init();
    a2dp_common_init();
    a2dp.enc_sampling_rate = 0;
    a2dp.enc_sampling_rate = 0;
    a2dp.enc_channels = 0;
    a2dp.enc_channels = 0;
@@ -1559,8 +1557,7 @@ int audio_extn_a2dp_set_parameters(struct str_parms *parms, bool *reconfig)
         val = atoi(value);
         val = atoi(value);
         if (audio_is_a2dp_out_device(val)) {
         if (audio_is_a2dp_out_device(val)) {
             ALOGV("%s: Received device disconnect request", __func__);
             ALOGV("%s: Received device disconnect request", __func__);
             reset_a2dp_enc_config_params();
             reset_a2dp_config();
             reset_a2dp_dec_config_params();
             close_a2dp_output();
             close_a2dp_output();
         }
         }
         goto param_handled;
         goto param_handled;