android/handsfree: Fix not needed codec negotiation

If codec was already negotiated there is no need to do it again and AG
may try connecting SCO right away. This fix regression from f264a65170.
This commit is contained in:
Szymon Janc 2014-03-14 13:42:11 +01:00
parent 72b36c7854
commit 5ab9740fbc

View File

@ -1650,8 +1650,9 @@ static bool disconnect_sco(void)
static bool connect_audio(void)
{
if (device.features & HFP_HF_FEAT_CODEC) {
select_codec(device.negotiated_codec);
/* we haven't negotiated codec, start selection */
if ((device.features & HFP_HF_FEAT_CODEC) && !device.negotiated_codec) {
select_codec(0);
return true;
}