summaryrefslogtreecommitdiffstats
path: root/btif
diff options
context:
space:
mode:
authorKausik Sinnaswamy <kausik@broadcom.com>2012-06-19 13:27:30 +0530
committerMatthew Xie <mattx@google.com>2012-07-14 11:19:23 -0700
commit2c79674ef766378464559c8645c74db5687280a9 (patch)
tree523610e2ac81b57c08d552c5b6281cfcc91ec432 /btif
parent1144d2b375fc67c9b48298e0ffd774d969cfd2cc (diff)
downloadexternal_bluetooth_bluedroid-2c79674ef766378464559c8645c74db5687280a9.zip
external_bluetooth_bluedroid-2c79674ef766378464559c8645c74db5687280a9.tar.gz
external_bluetooth_bluedroid-2c79674ef766378464559c8645c74db5687280a9.tar.bz2
Send SCO_AUDIO_CONNECTING on connect_audio
This translates to AUDIO_STATE_CHANGED intent with state STATE_AUDIO_CONNECTING which is needed for AudioService/AudioManager to suspend music Change-Id: I1293c105aaf1486f046620d5778c680908aad362
Diffstat (limited to 'btif')
-rw-r--r--btif/include/btif_common.h3
-rwxr-xr-xbtif/src/btif_hf.c32
2 files changed, 35 insertions, 0 deletions
diff --git a/btif/include/btif_common.h b/btif/include/btif_common.h
index 8ae52e9..5613004 100644
--- a/btif/include/btif_common.h
+++ b/btif/include/btif_common.h
@@ -141,6 +141,9 @@ enum
BTIF_DM_CB_HID_REMOTE_NAME, /* Remote name callback for HID device */
BTIF_DM_CB_BOND_STATE_BONDING,
+ BTIF_HFP_CB_START = BTIF_SIG_CB_START(BTIF_HFP),
+ BTIF_HFP_CB_AUDIO_CONNECTING, /* HF AUDIO connect has been sent to BTA successfully */
+
BTIF_PAN_CB_START = BTIF_SIG_CB_START(BTIF_PAN),
BTIF_PAN_CB_DISCONNECTING, /* PAN Disconnect has been sent to BTA successfully */
};
diff --git a/btif/src/btif_hf.c b/btif/src/btif_hf.c
index 63b1787..0c0ed59 100755
--- a/btif/src/btif_hf.c
+++ b/btif/src/btif_hf.c
@@ -471,6 +471,34 @@ static void bte_hf_evt(tBTA_AG_EVT event, tBTA_AG *p_data)
/*******************************************************************************
**
+** Function btif_in_hf_generic_evt
+**
+** Description Processes generic events to be sent to JNI that are not triggered from the BTA.
+** Always runs in BTIF context
+**
+** Returns void
+**
+*******************************************************************************/
+static void btif_in_hf_generic_evt(UINT16 event, char *p_param)
+{
+ BTIF_TRACE_EVENT2("%s: event=%d", __FUNCTION__, event);
+ switch (event) {
+ case BTIF_HFP_CB_AUDIO_CONNECTING:
+ {
+ HAL_CBACK(bt_hf_callbacks, audio_state_cb, BTHF_AUDIO_STATE_CONNECTING,
+ &btif_hf_cb.connected_bda);
+ } break;
+ default:
+ {
+ BTIF_TRACE_WARNING2("%s : Unknown event 0x%x", __FUNCTION__, event);
+ }
+ break;
+ }
+}
+
+
+/*******************************************************************************
+**
** Function btif_hf_init
**
** Description initializes the hf interface
@@ -562,6 +590,10 @@ static bt_status_t connect_audio( bt_bdaddr_t *bd_addr )
if (is_connected(bd_addr))
{
BTA_AgAudioOpen(btif_hf_cb.handle);
+
+ /* Inform the application that the audio connection has been initiated successfully */
+ btif_transfer_context(btif_in_hf_generic_evt, BTIF_HFP_CB_AUDIO_CONNECTING,
+ (char *)bd_addr, sizeof(bt_bdaddr_t), NULL);
return BT_STATUS_SUCCESS;
}