From 193262bd8e44e392a4bf2f3ac0705e6d3e101ee1 Mon Sep 17 00:00:00 2001 From: Andre Eisenbach Date: Wed, 16 May 2012 14:55:03 -0700 Subject: Cleaned-up HF/AV profile serialization code Change-Id: I064e750d7a446aa1785324df3df1b6b9fc80848e --- btif/src/btif_av.c | 10 +++------- btif/src/btif_hf.c | 2 -- 2 files changed, 3 insertions(+), 9 deletions(-) (limited to 'btif') diff --git a/btif/src/btif_av.c b/btif/src/btif_av.c index d8805df..b350448 100644 --- a/btif/src/btif_av.c +++ b/btif/src/btif_av.c @@ -731,20 +731,16 @@ static bt_status_t connect_int(bt_bdaddr_t *bd_addr) { BTIF_TRACE_EVENT1("%s", __FUNCTION__); - BTIF_TRACE_ERROR1("callbacks is 0x%x", bt_av_callbacks); - CHECK_BTAV_INIT(); - - memcpy(&btif_av_cb.peer_bda, bd_addr, sizeof(bt_bdaddr_t)); - BTA_AvOpen(btif_av_cb.peer_bda.address, btif_av_cb.bta_handle, - TRUE, BTA_SEC_NONE); - btif_sm_change_state(btif_av_cb.sm_handle, BTIF_AV_STATE_OPENING); + btif_sm_dispatch(btif_av_cb.sm_handle, BTIF_AV_CONNECT_REQ_EVT, (char*)bd_addr); return BT_STATUS_SUCCESS; } static bt_status_t connect(bt_bdaddr_t *bd_addr) { + BTIF_TRACE_EVENT1("%s", __FUNCTION__); CHECK_BTAV_INIT(); + return btif_queue_connect(UUID_SERVCLASS_AUDIO_SOURCE, bd_addr, connect_int); } diff --git a/btif/src/btif_hf.c b/btif/src/btif_hf.c index f413c42..2db01fd 100755 --- a/btif/src/btif_hf.c +++ b/btif/src/btif_hf.c @@ -495,8 +495,6 @@ static bt_status_t init( bthf_callbacks_t* callbacks ) *******************************************************************************/ static bt_status_t connect_int( bt_bdaddr_t *bd_addr ) { - CHECK_BTHF_INIT(); - if (!is_connected(bd_addr)) { btif_hf_cb.state = BTHF_CONNECTION_STATE_CONNECTING; -- cgit v1.1