summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRavi Nagarajan <nravi@broadcom.com>2012-06-14 14:11:05 +0530
committerMatthew Xie <mattx@google.com>2012-07-14 11:19:23 -0700
commitfed66f7b66d29da466e2e67befe3238e7ed8fc6a (patch)
tree2910a40fadafc6d9774134bf277b85f4a06f3146
parent548ae5f7abd366a6d85b485875dee401d2411f67 (diff)
downloadexternal_bluetooth_bluedroid-fed66f7b66d29da466e2e67befe3238e7ed8fc6a.zip
external_bluetooth_bluedroid-fed66f7b66d29da466e2e67befe3238e7ed8fc6a.tar.gz
external_bluetooth_bluedroid-fed66f7b66d29da466e2e67befe3238e7ed8fc6a.tar.bz2
Handle AG SLC setup timeout
If the AG SLC is not setup within 10 seconds, disconnect the link Change-Id: If60338e821e575bf46bb81a5f3a640b7d530eb2f
-rw-r--r--bta/ag/bta_ag_cmd.c2
-rw-r--r--bta/ag/bta_ag_main.c2
-rwxr-xr-xbtif/src/btif_hf.c4
3 files changed, 6 insertions, 2 deletions
diff --git a/bta/ag/bta_ag_cmd.c b/bta/ag/bta_ag_cmd.c
index ae0febd..632f6f5 100644
--- a/bta/ag/bta_ag_cmd.c
+++ b/bta/ag/bta_ag_cmd.c
@@ -25,7 +25,7 @@
*****************************************************************************/
/* ring timeout */
-#define BTA_AG_RING_TOUT 4000
+#define BTA_AG_RING_TOUT 10000
#define BTA_AG_CMD_MAX_VAL 32767 /* Maximum value is signed 16-bit value */
diff --git a/bta/ag/bta_ag_main.c b/bta/ag/bta_ag_main.c
index df576cc..1a3bf71 100644
--- a/bta/ag/bta_ag_main.c
+++ b/bta/ag/bta_ag_main.c
@@ -205,7 +205,7 @@ const UINT8 bta_ag_st_open[][BTA_AG_NUM_COLS] =
/* DISC_FAIL_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_OPEN_ST},
/* CI_RX_WRITE_EVT */ {BTA_AG_CI_RX_DATA, BTA_AG_IGNORE, BTA_AG_OPEN_ST},
/* RING_TOUT_EVT */ {BTA_AG_SEND_RING, BTA_AG_IGNORE, BTA_AG_OPEN_ST},
-/* SVC_TOUT_EVT */ {BTA_AG_SVC_CONN_OPEN, BTA_AG_IGNORE, BTA_AG_OPEN_ST},
+/* SVC_TOUT_EVT */ {BTA_AG_START_CLOSE, BTA_AG_IGNORE, BTA_AG_CLOSING_ST},
/* CI_SCO_DATA_EVT */ {BTA_AG_CI_SCO_DATA, BTA_AG_IGNORE, BTA_AG_OPEN_ST},
/* CI_SLC_READY_EVT */ {BTA_AG_RCVD_SLC_READY, BTA_AG_IGNORE, BTA_AG_OPEN_ST}
};
diff --git a/btif/src/btif_hf.c b/btif/src/btif_hf.c
index bcbf00a..63b1787 100755
--- a/btif/src/btif_hf.c
+++ b/btif/src/btif_hf.c
@@ -328,6 +328,10 @@ static void btif_hf_upstreams_evt(UINT16 event, char* p_param)
bdsetany(btif_hf_cb.connected_bda.address);
btif_hf_cb.peer_feat = 0;
clear_phone_state();
+ /* If AG_OPEN was received but SLC was not setup in a specified time (10 seconds),
+ ** then AG_CLOSE may be received. We need to advance the queue here
+ */
+ btif_queue_advance();
break;
case BTA_AG_CONN_EVT: