From 5ab9740fbc204793f7129c06786badbc59f0a8a9 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Fri, 14 Mar 2014 13:42:11 +0100 Subject: [PATCH] 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. --- android/handsfree.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/android/handsfree.c b/android/handsfree.c index e48885991..76c05f8f8 100644 --- a/android/handsfree.c +++ b/android/handsfree.c @@ -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; } -- 2.47.3