Treat devices advertising random addr. as LE only
Some remote devices use random addresses, but are not setting the
"BR/EDR not supported" flag. Thus we try to connect to the device using
BR/EDR.
This patch ignores the ADV flags if the device is using a random
address and always makes the connection over the LE transport.
bug 11418071
Change-Id: I628775b819abd8f17745aaf98db4bb3c59166955
diff --git a/stack/btm/btm_ble_gap.c b/stack/btm/btm_ble_gap.c
index 387f661..47ee8cf 100644
--- a/stack/btm/btm_ble_gap.c
+++ b/stack/btm/btm_ble_gap.c
@@ -1566,8 +1566,13 @@
if ((p_cur->flag & BTM_BLE_BREDR_NOT_SPT) == 0 &&
evt_type != BTM_BLE_CONNECT_DIR_EVT)
{
- BTM_TRACE_DEBUG0("BR/EDR NOT support bit not set, treat as DUMO");
- p_cur->device_type |= BT_DEVICE_TYPE_DUMO;
+ if (p_cur->ble_addr_type != BLE_ADDR_RANDOM)
+ {
+ BTM_TRACE_DEBUG0("BR/EDR NOT support bit not set, treat as DUMO");
+ p_cur->device_type |= BT_DEVICE_TYPE_DUMO;
+ } else {
+ BTM_TRACE_DEBUG0("Random address, treating device as LE only");
+ }
}
else
{