bta_av: avoid trying to get codecs before the stream starts
Trying to get current codec in a wrong state of the Stream State Machine possibly caused a crash. Now we only ask for current codec if the stream started. Also added refactor that changes logic for: ''' if (::bluetooth::audio::a2dp::provider::supports_codec(codec_config->codecIndex())) { bta_av_vendor_offload_start_v2(p_scb, static_cast<A2dpCodecConfigExt*>(codec_config)); ''' As it did not return after, the implementation sent BTA_AV_OFFLOAD_START_RSP_EVT with a BTA_AV_FAIL_RESOURCES. Bug: 383207190 Flag: EXEMPT - minor refactor Test: mmm packages/modules/Bluetooth Change-Id: I6e83337a4bc343a3fcad0d6544f14f7471c3e785
Loading
Please register or sign in to comment