summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKausik Sinnaswamy <kausik@broadcom.com>2012-06-27 16:45:26 +0530
committerMatthew Xie <mattx@google.com>2012-07-25 01:09:04 -0700
commitf06e7cebf18e93cf320a285c2c67ef79b98b13e0 (patch)
treeff86e4067a362432bfb2ffb770bbf7ea88309da9
parentb280b2fc2bc025e0fb2cc2eb03b31574ceb3bdfc (diff)
downloadexternal_bluetooth_bluedroid-f06e7cebf18e93cf320a285c2c67ef79b98b13e0.zip
external_bluetooth_bluedroid-f06e7cebf18e93cf320a285c2c67ef79b98b13e0.tar.gz
external_bluetooth_bluedroid-f06e7cebf18e93cf320a285c2c67ef79b98b13e0.tar.bz2
Fix for unpair failure during music streaming
Fix for a potential race condition where unpair was failing is music was streaming. The issue was due to the unpair callback not being invoked Change-Id: I5dff05abd238b4af3301495be05cbaa970d275d6
-rw-r--r--bta/dm/bta_dm_act.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/bta/dm/bta_dm_act.c b/bta/dm/bta_dm_act.c
index 5d80891..24ab3bf 100644
--- a/bta/dm/bta_dm_act.c
+++ b/bta/dm/bta_dm_act.c
@@ -3418,7 +3418,12 @@ static void bta_dm_rm_cback(tBTA_SYS_CONN_STATUS status, UINT8 id, UINT8 app_id,
{
if(p_dev)
{
- p_dev->conn_state = BTA_DM_CONNECTED;
+ /* Do not set to connected if we are in the middle of unpairing. When AV stream is
+ * started it fakes out a SYS_CONN_OPEN to potentially trigger a role switch command.
+ * But this should not be done if we are in the middle of unpairing.
+ */
+ if (p_dev->conn_state != BTA_DM_UNPAIRING)
+ p_dev->conn_state = BTA_DM_CONNECTED;
for(j=1; j<= p_bta_dm_rm_cfg[0].app_id; j++)
{