aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2021-11-04 18:36:16 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2021-11-04 18:36:16 +0000
commit69fce043c3ff5593ce237a2ee3835489aa48f0fd (patch)
tree8b952263abe80fb8303343590cd5b4f645baae36
parent24862207293f2dc67b59ae65406e971059973c92 (diff)
parent6d927a98f249362c562a7eaeb482473979808600 (diff)
downloadbt-69fce043c3ff5593ce237a2ee3835489aa48f0fd.tar.gz
Merge "Fix wrong address type of DUAL mode device"
-rw-r--r--stack/btm/btm_ble.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/stack/btm/btm_ble.cc b/stack/btm/btm_ble.cc
index 805a1e285..3d0228de5 100644
--- a/stack/btm/btm_ble.cc
+++ b/stack/btm/btm_ble.cc
@@ -485,16 +485,21 @@ void BTM_ReadDevInfo(const RawAddress& remote_bda, tBT_DEVICE_TYPE* p_dev_type,
p_dev_rec->device_type = p_inq_info->results.device_type;
p_dev_rec->ble.ble_addr_type = p_inq_info->results.ble_addr_type;
}
- if (p_dev_rec->bd_addr == remote_bda && p_dev_rec->device_type != 0) {
+
+ if (p_dev_rec->bd_addr == remote_bda &&
+ p_dev_rec->ble.pseudo_addr == remote_bda) {
*p_dev_type = p_dev_rec->device_type;
*p_addr_type = p_dev_rec->ble.ble_addr_type;
} else if (p_dev_rec->ble.pseudo_addr == remote_bda) {
*p_dev_type = BT_DEVICE_TYPE_BLE;
*p_addr_type = p_dev_rec->ble.ble_addr_type;
- } else /* matching static adddress only */
- {
- LOG(ERROR) << __func__ << " device_type not set; assuming BR/EDR";
- *p_dev_type = BT_DEVICE_TYPE_BREDR;
+ } else /* matching static adddress only */ {
+ if (p_dev_rec->device_type != BT_DEVICE_TYPE_UNKNOWN) {
+ *p_dev_type = p_dev_rec->device_type;
+ } else {
+ LOG_WARN("device_type not set; assuming BR/EDR");
+ *p_dev_type = BT_DEVICE_TYPE_BREDR;
+ }
*p_addr_type = BLE_ADDR_PUBLIC;
}
}