aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Brabham <optedoblivion@google.com>2022-01-05 17:42:08 +0000
committerMartin Brabham <optedoblivion@google.com>2022-01-20 17:16:26 +0000
commitcf0e121386927ae6ed0069a006d19e6e51efe52f (patch)
tree5deb3dcb2b3527f44d7b22ff88d8e866dfeede58
parenta376181caab1553b7ed96e34a3ca163e2afc66cb (diff)
BLE Scanning: Pass correct address type for scanning
Bug: 202162086 Test: Manual Tag: #feature Change-Id: I0eb9a57ced9a09650e07a2c2f99cbf14d62d9085
-rw-r--r--android/app/src/com/android/bluetooth/gatt/ScanFilterQueue.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/android/app/src/com/android/bluetooth/gatt/ScanFilterQueue.java b/android/app/src/com/android/bluetooth/gatt/ScanFilterQueue.java
index 4572c89b75..8231519e39 100644
--- a/android/app/src/com/android/bluetooth/gatt/ScanFilterQueue.java
+++ b/android/app/src/com/android/bluetooth/gatt/ScanFilterQueue.java
@@ -181,13 +181,13 @@ import java.util.UUID;
addName(filter.getDeviceName());
}
if (filter.getDeviceAddress() != null) {
- byte addressType = (byte) filter.getAddressType();
- // If addressType == iADDRESS_TYPE_PUBLIC (0) then this is the original
- // setDeviceAddress(address) API path which provided DEVICE_TYPE_ALL (2) which might map
- // to the stack value for address type of BTM_BLE_STATIC (2)
- // Additionally, we shouldn't confuse device type with address type.
- addDeviceAddress(filter.getDeviceAddress(),
- ((addressType == 0) ? DEVICE_TYPE_ALL : addressType), filter.getIrk());
+ /*
+ * Pass the addres type here. This address type will be used for the resolving address,
+ * however, the host stack will force the type to 0x02 for the APCF filter in
+ * btm_ble_adv_filter.cc#BTM_LE_PF_addr_filter(...)
+ */
+ addDeviceAddress(filter.getDeviceAddress(), (byte) filter.getAddressType(),
+ filter.getIrk());
}
if (filter.getServiceUuid() != null) {
if (filter.getServiceUuidMask() == null) {