summaryrefslogtreecommitdiffstats
path: root/stack/btm
diff options
context:
space:
mode:
authorvenkata Jagadeesh <vjagad@codeaurora.org>2013-06-25 16:34:00 +0530
committerLinux Build Service Account <lnxbuild@localhost>2015-10-06 03:22:08 -0600
commit2d2cb9c9a9e1a610eedc972d87361ae4c2e7519c (patch)
tree452b45db647392d74983fd8a885e15b3071e8e8f /stack/btm
parentd5685a143c9cfff5c833c5120c4f07693bdfb100 (diff)
downloadandroid_system_bt-2d2cb9c9a9e1a610eedc972d87361ae4c2e7519c.tar.gz
android_system_bt-2d2cb9c9a9e1a610eedc972d87361ae4c2e7519c.tar.bz2
android_system_bt-2d2cb9c9a9e1a610eedc972d87361ae4c2e7519c.zip
Bluetooth: Do not go for inquiry in BONDING State
This patch fix a special case where DUT is paired & connected with only one device, which has capbility to intiate paring as soon as DUT unpair same remote device. As DUT is paired with only one device, In this case Once DUT unpair remote device. DUT goes for inquiry & at same time remote device initiates pairing if Bludroid stack recieve pairing request before the inquiry start then DUT should not go for inquiry, As DUT is already in BONDING state. Change-Id: I0e1ec0fdb963921629e5c52f495ae2013e679a03 SDP: Fix for SDP query in certification test with Invalid PduSize Bluedroid stack is only checking parameter length and input data length. Added an extra logic to handle invalid data after getting last valid data. Change-Id: I47eafb2c24e73b472c31a2fb47e02d48c5e04f6c Bluetooth: GAP: Don't update short name if the device paired Don't notify the BT APP about the shortened device name which will be part of EIR response,incase of device is already paired. Incase if the alias name present for that device, it will notify th BT APP alias name as the actual device name. Change-Id: Ia64e1e90aae8c4e0cc52643ce3bbbb1332fe5b66 Bluetooth: GAP: Update name as part of Discovery of services Update the remote device name to upper layers as part of discovery of remote device services. Change-Id: I24d899c1f5ccc81d8b0c4257abae16a7bf5d4682 Bluetooth: GAP: Handle security failure with invalid handle Return NULL incase of invalid handle when finding a device based on the handle. This will make sure to avoid giving a invalid entry from the device list. Also send authentication failure in case of invalid handle. Change-Id: Ia95d10ae95cfa1750386233ee90f01899061294e Bluetooth: Handled delayed info rsp from remote during SDP DUT initiates connection with out waiting for information response from remote device during SDP. Change-Id: Iee0251f8f81923b1291983b66b31c78e14d21af0 Bluetooth: GAP: Changing the security to general bonding Changing the security from non bonding to general bonding in BTM_SEC_OUT_AUTHENTICATE condition. Change-Id: I65d2ec4466e2bd81df2cc7e2936e05159a8645ed Bluetooth: Store local and remote io caps before RNR Stores the loc_io_caps nad rmt_io_caps when the remote name request is called, and these will be retrieved in the function bta_dm_pinname_cback. Change-Id: I4b2156d7101acabb1ded65bd21d49a9c4551f8db Bluetooth:GAP: Remove bonded device info on pairing rejected Change-Id: Ic9e5e1ed70d304edd3dbca82a73833753fa0093c Remove bonded device information from the BT-IF layer storage When authentication failed with reason pairing not allowed from remote. Change-Id: I71b902ae201e32a0fb18fd3bce52fd86e8cbcdd5 CRs-Fixed: 902577
Diffstat (limited to 'stack/btm')
-rw-r--r--stack/btm/btm_dev.c31
-rw-r--r--stack/btm/btm_sec.c19
2 files changed, 48 insertions, 2 deletions
diff --git a/stack/btm/btm_dev.c b/stack/btm/btm_dev.c
index 0189bdab9..44a3bf8a9 100644
--- a/stack/btm/btm_dev.c
+++ b/stack/btm/btm_dev.c
@@ -418,6 +418,12 @@ tBTM_SEC_DEV_REC *btm_find_dev_by_handle (UINT16 handle)
tBTM_SEC_DEV_REC *p_dev_rec = &btm_cb.sec_dev_rec[0];
int i;
+ if(handle == BTM_INVALID_HCI_HANDLE)
+ {
+ BTM_TRACE_DEBUG("btm_find_dev_by_handle: Invalid handle");
+ return (NULL);
+ }
+
for (i = 0; i < BTM_SEC_MAX_DEVICE_RECORDS; i++, p_dev_rec++)
{
if ((p_dev_rec->sec_flags & BTM_SEC_IN_USE)
@@ -433,6 +439,31 @@ tBTM_SEC_DEV_REC *btm_find_dev_by_handle (UINT16 handle)
/*******************************************************************************
**
+** Function btm_find_dev_by_sec_state
+**
+** Description Look for the record in the device database for the record
+** with specific security state
+**
+** Returns Pointer to the record or NULL
+**
+*******************************************************************************/
+tBTM_SEC_DEV_REC *btm_find_dev_by_sec_state(UINT8 sec_state)
+{
+ tBTM_SEC_DEV_REC *p_dev_rec = &btm_cb.sec_dev_rec[0];
+ int i;
+ BTM_TRACE_DEBUG("btm_find_dev_by_sec_state: sec_state : %d", sec_state);
+
+ for (i = 0; i < BTM_SEC_MAX_DEVICE_RECORDS; i++, p_dev_rec++)
+ {
+ if ((p_dev_rec->sec_flags & BTM_SEC_IN_USE)
+ && (p_dev_rec->sec_state == sec_state))
+ return(p_dev_rec);
+ }
+ return(NULL);
+}
+
+/*******************************************************************************
+**
** Function btm_find_dev
**
** Description Look for the record in the device database for the record
diff --git a/stack/btm/btm_sec.c b/stack/btm/btm_sec.c
index d439cfc34..e35b148b8 100644
--- a/stack/btm/btm_sec.c
+++ b/stack/btm/btm_sec.c
@@ -3803,7 +3803,7 @@ False-positive: evt_data.bd_addr is set at the beginning with: STREAM_TO_BDA
else
{
evt_data.auth_req = (p_dev_rec->p_cur_service->security_flags &
- BTM_SEC_OUT_MITM)? BTM_AUTH_SP_YES : BTM_AUTH_SP_NO;
+ BTM_SEC_OUT_MITM)? BTM_AUTH_SPGB_YES : BTM_AUTH_SPGB_NO;
}
}
}
@@ -4361,8 +4361,23 @@ void btm_sec_auth_complete (UINT16 handle, UINT8 status)
}
if (!p_dev_rec)
- return;
+ {
+ /* check if the handle is BTM_INVALID_HCI_HANDLE */
+ if(handle == BTM_INVALID_HCI_HANDLE)
+ {
+ /* get the device with auth type as BTM_SEC_STATE_AUTHENTICATING */
+ p_dev_rec = btm_find_dev_by_sec_state(BTM_SEC_STATE_AUTHENTICATING);
+ if ( p_dev_rec && (btm_cb.api.p_auth_complete_callback))
+ {
+ (*btm_cb.api.p_auth_complete_callback) (p_dev_rec->bd_addr,
+ p_dev_rec->dev_class,
+ p_dev_rec->sec_bd_name, status);
+ BTM_TRACE_DEBUG("btm_sec_auth_complete: Invalid Handle, send Auth failure");
+ }
+ }
+ return;
+ }
/* keep the old sm4 flag and clear the retry bit in control block */
old_sm4 = p_dev_rec->sm4;
p_dev_rec->sm4 &= ~BTM_SM4_RETRY;