le: Default to PUBLIC not RANDOM address type
Bug: 230051991
Tag: #refactor
Test: gd/cert/run
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines
Change-Id: I11843870e7108be6868ed90c81b6e605b842fb70
diff --git a/system/stack/acl/btm_acl.cc b/system/stack/acl/btm_acl.cc
index af8852d..5632151 100644
--- a/system/stack/acl/btm_acl.cc
+++ b/system/stack/acl/btm_acl.cc
@@ -2761,21 +2761,21 @@
}
bool acl_create_le_connection_with_id(uint8_t id, const RawAddress& bd_addr) {
- tBLE_BD_ADDR address_with_type{
- .bda = bd_addr,
- .type = BLE_ADDR_RANDOM,
- };
- gatt_find_in_device_record(bd_addr, &address_with_type);
- LOG_DEBUG("Creating le direct connection to:%s",
- PRIVATE_ADDRESS(address_with_type));
+ tBLE_BD_ADDR address_with_type{
+ .bda = bd_addr,
+ .type = BLE_ADDR_PUBLIC,
+ };
+ gatt_find_in_device_record(bd_addr, &address_with_type);
+ LOG_DEBUG("Creating le direct connection to:%s",
+ PRIVATE_ADDRESS(address_with_type));
- if (address_with_type.type == BLE_ADDR_ANONYMOUS) {
- LOG_WARN(
- "Creating le direct connection to:%s, address type 'anonymous' is "
- "invalid",
- PRIVATE_ADDRESS(address_with_type));
- return false;
- }
+ if (address_with_type.type == BLE_ADDR_ANONYMOUS) {
+ LOG_WARN(
+ "Creating le direct connection to:%s, address type 'anonymous' is "
+ "invalid",
+ PRIVATE_ADDRESS(address_with_type));
+ return false;
+ }
bluetooth::shim::ACL_AcceptLeConnectionFrom(address_with_type,
/* is_direct */ true);