summaryrefslogtreecommitdiffstats
path: root/btif
diff options
context:
space:
mode:
authorGanesh Ganapathi Batta <ganeshg@broadcom.com>2012-09-12 19:03:47 -0700
committerMatthew Xie <mattx@google.com>2012-09-19 11:12:41 -0700
commitf64e0edafe8ce32565ada5c3c7898e9a947e8cd0 (patch)
tree8b5dd99dd36d66a2975dbf50f468dc7772b3a8ae /btif
parent6ef101187774e30ddba6b46bbedef549a42196ad (diff)
downloadexternal_bluetooth_bluedroid-f64e0edafe8ce32565ada5c3c7898e9a947e8cd0.zip
external_bluetooth_bluedroid-f64e0edafe8ce32565ada5c3c7898e9a947e8cd0.tar.gz
external_bluetooth_bluedroid-f64e0edafe8ce32565ada5c3c7898e9a947e8cd0.tar.bz2
Defer sending RC pass-through commands until A2DP connection is up
Root cause for the bug is RC connection establishment before A2DP connection and play command from carkit arriving in mid of A2DP connection. Bug: 7131791 Change-Id: I74e7c456f68c5ab5a02e827c9a1e14d770f5ec2a
Diffstat (limited to 'btif')
-rwxr-xr-x[-rw-r--r--]btif/src/btif_av.c6
-rw-r--r--btif/src/btif_rc.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/btif/src/btif_av.c b/btif/src/btif_av.c
index a2de03e..d25fb61 100644..100755
--- a/btif/src/btif_av.c
+++ b/btif/src/btif_av.c
@@ -399,7 +399,6 @@ static BOOLEAN btif_av_state_closing_handler(btif_sm_event_t event, void *p_data
/* immediately stop transmission of frames */
btif_a2dp_set_tx_flush(TRUE);
-
/* wait for audioflinger to stop a2dp */
break;
@@ -963,7 +962,8 @@ const btav_interface_t *btif_av_get_interface(void)
** Returns boolean
**
*******************************************************************************/
-BOOLEAN btif_av_is_rc_open_without_a2dp(void)
+BOOLEAN btif_av_is_connected(void)
{
- return (tle_av_open_on_rc.in_use);
+ btif_sm_state_t state = btif_sm_get_state(btif_av_cb.sm_handle);
+ return ((state == BTIF_AV_STATE_OPENED) || (state == BTIF_AV_STATE_STARTED));
}
diff --git a/btif/src/btif_rc.c b/btif/src/btif_rc.c
index 530c7f1..68ddf5b 100644
--- a/btif/src/btif_rc.c
+++ b/btif/src/btif_rc.c
@@ -100,7 +100,7 @@ static btif_rc_cb_t btif_rc_cb;
******************************************************************************/
extern BOOLEAN btif_hf_call_terminated_recently();
extern BOOLEAN check_cod(const bt_bdaddr_t *remote_bdaddr, uint32_t cod);
-BOOLEAN btif_av_is_rc_open_without_a2dp(void);
+extern BOOLEAN btif_av_is_connected(void);
/*****************************************************************************
** Functions
@@ -299,7 +299,7 @@ void handle_rc_passthrough_cmd ( tBTA_AV_REMOTE_CMD *p_remote_cmd)
if (p_remote_cmd)
{
/* queue AVRC PLAY if GAVDTP Open notification to app is pending (2 second timer) */
- if ((p_remote_cmd->rc_id == BTA_AV_RC_PLAY) && btif_av_is_rc_open_without_a2dp())
+ if ((p_remote_cmd->rc_id == BTA_AV_RC_PLAY) && (!btif_av_is_connected()))
{
if (p_remote_cmd->key_state == AVRC_STATE_PRESS)
{