diff options
author | Balraj Selvaraj <bselva@codeaurora.org> | 2016-02-11 13:46:02 +0530 |
---|---|---|
committer | Balraj Selvaraj <bselva@codeaurora.org> | 2016-02-11 16:43:18 +0530 |
commit | 4ea955cc4caaed6cbfc0a22ef733008bbecc274c (patch) | |
tree | 0e9a0669ab35fbcc1b97791babcac99ad19f3f55 | |
parent | 1b380b090c6bc188951029e4232e7e13a6c71c15 (diff) | |
download | android_system_bt-4ea955cc4caaed6cbfc0a22ef733008bbecc274c.tar.gz android_system_bt-4ea955cc4caaed6cbfc0a22ef733008bbecc274c.tar.bz2 android_system_bt-4ea955cc4caaed6cbfc0a22ef733008bbecc274c.zip |
Bluetooth: GAP: Setting remove device pending status as FALSE
Issue scenario:
- Pair the DUT and HS. (Link Keys get established.)
- Now Switch OFF BT on DUT. (DUT still has the Link key of HS)
- Reset the paired devices memory in HS and keep HS in
pairing mode. (HS loses DUT's link key)
- Now switch ON BT on DUT. (DUt starts reconnection with HS,
but as HS lost DUT's key, PIN or KEY missing event will
come to host)
- DUT reconnects to HS (Using newly established link keys)
- Now power OFF and ON the HS.
- HS will try reconnection with DUT.
- While there is an incoming connection from HS to DUT,
host is giving negative link key reply always for the
multiple link key requests from HS.
- HS sends disconnection with "Authentication failure"
Fix:
Setting the remove device pending status to FALSE from
security device DB, when the link key notification event
comes. Basically it will avoid deleting the device from
security device DB, Which is solving the reconnection
initated from remote when we remove the link key at
remote side.
Change-Id: Ic164d8d5b5c2e0b9cc5f04f993047fb0a8e5d9a9
-rw-r--r-- | bta/dm/bta_dm_act.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/bta/dm/bta_dm_act.c b/bta/dm/bta_dm_act.c index 8d441c322..7fc46abaa 100644 --- a/bta/dm/bta_dm_act.c +++ b/bta/dm/bta_dm_act.c @@ -120,6 +120,7 @@ static void bta_dm_ctrl_features_rd_cmpl_cback(tBTM_STATUS result); #endif #endif +static void bta_dm_reset_sec_dev_pending(BD_ADDR remote_bd_addr); static void bta_dm_remove_sec_dev_entry(BD_ADDR remote_bd_addr); static void bta_dm_observe_results_cb(tBTM_INQ_RESULTS *p_inq, UINT8 *p_eir); static void bta_dm_observe_cmpl_cb(void * p_result); @@ -2890,6 +2891,12 @@ static UINT8 bta_dm_new_link_key_cback(BD_ADDR bd_addr, DEV_CLASS dev_class, #endif if(bta_dm_cb.p_sec_cback) bta_dm_cb.p_sec_cback(event, &sec_event); + + // Setting remove_dev_pending flag to FALSE, where it will avoid deleting the + // security device record when the ACL connection link goes down in case of + // reconnection. + if(bta_dm_cb.device_list.count) + bta_dm_reset_sec_dev_pending(p_auth_cmpl->bd_addr); } else { @@ -3643,6 +3650,31 @@ static void bta_dm_delay_role_switch_cback(TIMER_LIST_ENT *p_tle) /******************************************************************************* ** +** Function bta_dm_reset_sec_dev_pending +** +** Description Setting the remove device pending status to FALSE from +** security device DB, when the link key notification +** event comes. +** +** Returns void +** +*******************************************************************************/ +static void bta_dm_reset_sec_dev_pending(BD_ADDR remote_bd_addr) +{ + UINT16 index = 0; + for (index = 0; index < bta_dm_cb.device_list.count; index ++) + { + if (!bdcmp( bta_dm_cb.device_list.peer_device[index].peer_bdaddr, remote_bd_addr)) + break; + } + if (index != bta_dm_cb.device_list.count) + { + bta_dm_cb.device_list.peer_device[index].remove_dev_pending = FALSE; + } +} + +/******************************************************************************* +** ** Function bta_dm_remove_sec_dev_entry ** ** Description Removes device entry from Security device DB if ACL connection with |