OSDN Git Service

SCO connection should happen after SLC.
authorMallikarjuna GB <gbmalli@codeaurora.org>
Wed, 8 Oct 2014 08:31:16 +0000 (14:01 +0530)
committerAndre Eisenbach <eisenbach@google.com>
Wed, 10 Jun 2015 21:21:39 +0000 (21:21 +0000)
This change makes sure that SCO audio
connection request is not processed until
HFP SLC connection is done.

Change-Id: Ia2fcad49882deaaf049ae190d90442e5ca7ad71b

btif/src/btif_hf.c

index 248ebd5..ab0bb45 100644 (file)
@@ -803,6 +803,10 @@ static bt_status_t connect_audio( bt_bdaddr_t *bd_addr )
 
     int idx = btif_hf_idx_by_bdaddr(bd_addr);
 
+    /* Check if SLC is connected */
+    if (btif_hf_check_if_slc_connected() != BT_STATUS_SUCCESS)
+        return BT_STATUS_NOT_READY;
+
     if (is_connected(bd_addr) && (idx != BTIF_HF_INVALID_IDX))
     {
         BTA_AgAudioOpen(btif_hf_cb[idx].handle);