summaryrefslogtreecommitdiffstats
path: root/btif/src
diff options
context:
space:
mode:
authorPriti Aghera <paghera@broadcom.com>2012-04-12 15:55:13 -0700
committerMatthew Xie <mattx@google.com>2012-07-14 11:19:16 -0700
commitd9798df11d1061760f03577f93a8083492bb1582 (patch)
treee30e4b6660bdc3b3654356970b85307a63d20144 /btif/src
parentf7037fdded08d5642930e1dbc485961350227131 (diff)
downloadexternal_bluetooth_bluedroid-d9798df11d1061760f03577f93a8083492bb1582.zip
external_bluetooth_bluedroid-d9798df11d1061760f03577f93a8083492bb1582.tar.gz
external_bluetooth_bluedroid-d9798df11d1061760f03577f93a8083492bb1582.tar.bz2
Fix for first time pairing fails on bdroid phones
Change-Id: Ieed0ab975ae82120037169f9a8dce0f8e441992d
Diffstat (limited to 'btif/src')
-rwxr-xr-xbtif/src/btif_dm.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/btif/src/btif_dm.c b/btif/src/btif_dm.c
index 0032bb9..265b5af 100755
--- a/btif/src/btif_dm.c
+++ b/btif/src/btif_dm.c
@@ -445,15 +445,16 @@ static void btif_dm_pin_req_evt(tBTA_DM_PIN_REQ *p_pin_req)
UINT32 cod;
btif_dm_remote_name_t remote_param;
- bdcpy(bd_addr.address, p_pin_req->bd_addr);
- memcpy(bd_name.name, p_pin_req->bd_name, BD_NAME_LEN);
-
- bond_state_changed(BT_STATUS_SUCCESS, &bd_addr, BT_BOND_STATE_BONDING);
/* Remote name update */
bdcpy(remote_param.bd_addr , p_pin_req->bd_addr);
memcpy(remote_param.bd_name, p_pin_req->bd_name, BD_NAME_LEN);
btif_update_remote_name(remote_param);
+ bdcpy(bd_addr.address, p_pin_req->bd_addr);
+ memcpy(bd_name.name, p_pin_req->bd_name, BD_NAME_LEN);
+
+ bond_state_changed(BT_STATUS_SUCCESS, &bd_addr, BT_BOND_STATE_BONDING);
+
cod = devclass2uint(p_pin_req->dev_class);
if ( cod == 0) {
@@ -482,16 +483,17 @@ static void btif_dm_ssp_cfm_req_evt(tBTA_DM_SP_CFM_REQ *p_ssp_cfm_req)
btif_dm_remote_name_t remote_param;
BTIF_TRACE_DEBUG1("%s", __FUNCTION__);
- bdcpy(bd_addr.address, p_ssp_cfm_req->bd_addr);
- memcpy(bd_name.name, p_ssp_cfm_req->bd_name, BD_NAME_LEN);
- /* Set the pairing_cb based on the local & remote authentication requirements */
- bond_state_changed(BT_STATUS_SUCCESS, &bd_addr, BT_BOND_STATE_BONDING);
/* Remote name update */
bdcpy(remote_param.bd_addr , p_ssp_cfm_req->bd_addr);
memcpy(remote_param.bd_name, p_ssp_cfm_req->bd_name, BD_NAME_LEN);
btif_update_remote_name(remote_param);
+ bdcpy(bd_addr.address, p_ssp_cfm_req->bd_addr);
+ memcpy(bd_name.name, p_ssp_cfm_req->bd_name, BD_NAME_LEN);
+
+ /* Set the pairing_cb based on the local & remote authentication requirements */
+ bond_state_changed(BT_STATUS_SUCCESS, &bd_addr, BT_BOND_STATE_BONDING);
if ((p_ssp_cfm_req->loc_auth_req >= BTM_AUTH_AP_NO && p_ssp_cfm_req->rmt_auth_req >= BTM_AUTH_AP_NO) ||
(p_ssp_cfm_req->loc_auth_req == BTM_AUTH_AP_NO || p_ssp_cfm_req->loc_auth_req == BTM_AUTH_AP_YES) ||
(p_ssp_cfm_req->rmt_auth_req == BTM_AUTH_AP_NO || p_ssp_cfm_req->rmt_auth_req == BTM_AUTH_AP_YES))
@@ -527,15 +529,16 @@ static void btif_dm_ssp_key_notif_evt(tBTA_DM_SP_KEY_NOTIF *p_ssp_key_notif)
btif_dm_remote_name_t remote_param;
BTIF_TRACE_DEBUG1("%s", __FUNCTION__);
- bdcpy(bd_addr.address, p_ssp_key_notif->bd_addr);
- memcpy(bd_name.name, p_ssp_key_notif->bd_name, BD_NAME_LEN);
- bond_state_changed(BT_STATUS_SUCCESS, &bd_addr, BT_BOND_STATE_BONDING);
/* Remote name update */
bdcpy(remote_param.bd_addr , p_ssp_key_notif->bd_addr);
memcpy(remote_param.bd_name, p_ssp_key_notif->bd_name, BD_NAME_LEN);
btif_update_remote_name(remote_param);
+ bdcpy(bd_addr.address, p_ssp_key_notif->bd_addr);
+ memcpy(bd_name.name, p_ssp_key_notif->bd_name, BD_NAME_LEN);
+
+ bond_state_changed(BT_STATUS_SUCCESS, &bd_addr, BT_BOND_STATE_BONDING);
cod = devclass2uint(p_ssp_key_notif->dev_class);
if ( cod == 0) {