Loading system/gd/hci/le_address_manager.cc +1 −1 Original line number Original line Diff line number Diff line Loading @@ -150,7 +150,7 @@ void LeAddressManager::register_client(LeAddressManagerCallback* callback) { } else if ( } else if ( address_policy_ == AddressPolicy::USE_RESOLVABLE_ADDRESS || address_policy_ == AddressPolicy::USE_RESOLVABLE_ADDRESS || address_policy_ == AddressPolicy::USE_NON_RESOLVABLE_ADDRESS) { address_policy_ == AddressPolicy::USE_NON_RESOLVABLE_ADDRESS) { if (bluetooth::common::init_flags::gd_acl_is_enabled()) { if (bluetooth::common::init_flags::gd_acl_is_enabled() || bluetooth::common::init_flags::gd_l2cap_is_enabled()) { if (registered_clients_.size() == 1) { if (registered_clients_.size() == 1) { schedule_rotate_random_address(); schedule_rotate_random_address(); } } Loading system/main/shim/acl_api.cc +17 −1 Original line number Original line Diff line number Diff line Loading @@ -17,6 +17,7 @@ #include <cstddef> #include <cstddef> #include <cstdint> #include <cstdint> #include "gd/hci/acl_manager.h" #include "main/shim/acl_api.h" #include "main/shim/acl_api.h" #include "main/shim/helpers.h" #include "main/shim/helpers.h" #include "main/shim/stack.h" #include "main/shim/stack.h" Loading Loading @@ -49,7 +50,22 @@ void bluetooth::shim::ACL_WriteData(uint16_t handle, const BT_HDR* p_buf) { } } void bluetooth::shim::ACL_ConfigureLePrivacy(bool is_le_privacy_enabled) { void bluetooth::shim::ACL_ConfigureLePrivacy(bool is_le_privacy_enabled) { Stack::GetInstance()->GetAcl()->ConfigureLePrivacy(is_le_privacy_enabled); hci::LeAddressManager::AddressPolicy address_policy = is_le_privacy_enabled ? hci::LeAddressManager::AddressPolicy::USE_RESOLVABLE_ADDRESS : hci::LeAddressManager::AddressPolicy::USE_PUBLIC_ADDRESS; hci::AddressWithType empty_address_with_type( hci::Address{}, hci::AddressType::RANDOM_DEVICE_ADDRESS); /* 7 minutes minimum, 15 minutes maximum for random address refreshing */ auto minimum_rotation_time = std::chrono::minutes(7); auto maximum_rotation_time = std::chrono::minutes(15); Stack::GetInstance() ->GetStackManager() ->GetInstance<bluetooth::hci::AclManager>() ->SetPrivacyPolicyForInitiatorAddress( address_policy, empty_address_with_type, minimum_rotation_time, maximum_rotation_time); } } void bluetooth::shim::ACL_Disconnect(uint16_t handle, bool is_classic, void bluetooth::shim::ACL_Disconnect(uint16_t handle, bool is_classic, Loading system/stack/btm/btm_ble_gap.cc +2 −1 Original line number Original line Diff line number Diff line Loading @@ -705,7 +705,8 @@ bool BTM_BleConfigPrivacy(bool privacy_mode) { GAP_BleAttrDBUpdate(GATT_UUID_GAP_CENTRAL_ADDR_RESOL, &gap_ble_attr_value); GAP_BleAttrDBUpdate(GATT_UUID_GAP_CENTRAL_ADDR_RESOL, &gap_ble_attr_value); if (bluetooth::shim::is_gd_acl_enabled()) { if (bluetooth::shim::is_gd_acl_enabled() || bluetooth::shim::is_gd_l2cap_enabled()) { bluetooth::shim::ACL_ConfigureLePrivacy(privacy_mode); bluetooth::shim::ACL_ConfigureLePrivacy(privacy_mode); } } return true; return true; Loading Loading
system/gd/hci/le_address_manager.cc +1 −1 Original line number Original line Diff line number Diff line Loading @@ -150,7 +150,7 @@ void LeAddressManager::register_client(LeAddressManagerCallback* callback) { } else if ( } else if ( address_policy_ == AddressPolicy::USE_RESOLVABLE_ADDRESS || address_policy_ == AddressPolicy::USE_RESOLVABLE_ADDRESS || address_policy_ == AddressPolicy::USE_NON_RESOLVABLE_ADDRESS) { address_policy_ == AddressPolicy::USE_NON_RESOLVABLE_ADDRESS) { if (bluetooth::common::init_flags::gd_acl_is_enabled()) { if (bluetooth::common::init_flags::gd_acl_is_enabled() || bluetooth::common::init_flags::gd_l2cap_is_enabled()) { if (registered_clients_.size() == 1) { if (registered_clients_.size() == 1) { schedule_rotate_random_address(); schedule_rotate_random_address(); } } Loading
system/main/shim/acl_api.cc +17 −1 Original line number Original line Diff line number Diff line Loading @@ -17,6 +17,7 @@ #include <cstddef> #include <cstddef> #include <cstdint> #include <cstdint> #include "gd/hci/acl_manager.h" #include "main/shim/acl_api.h" #include "main/shim/acl_api.h" #include "main/shim/helpers.h" #include "main/shim/helpers.h" #include "main/shim/stack.h" #include "main/shim/stack.h" Loading Loading @@ -49,7 +50,22 @@ void bluetooth::shim::ACL_WriteData(uint16_t handle, const BT_HDR* p_buf) { } } void bluetooth::shim::ACL_ConfigureLePrivacy(bool is_le_privacy_enabled) { void bluetooth::shim::ACL_ConfigureLePrivacy(bool is_le_privacy_enabled) { Stack::GetInstance()->GetAcl()->ConfigureLePrivacy(is_le_privacy_enabled); hci::LeAddressManager::AddressPolicy address_policy = is_le_privacy_enabled ? hci::LeAddressManager::AddressPolicy::USE_RESOLVABLE_ADDRESS : hci::LeAddressManager::AddressPolicy::USE_PUBLIC_ADDRESS; hci::AddressWithType empty_address_with_type( hci::Address{}, hci::AddressType::RANDOM_DEVICE_ADDRESS); /* 7 minutes minimum, 15 minutes maximum for random address refreshing */ auto minimum_rotation_time = std::chrono::minutes(7); auto maximum_rotation_time = std::chrono::minutes(15); Stack::GetInstance() ->GetStackManager() ->GetInstance<bluetooth::hci::AclManager>() ->SetPrivacyPolicyForInitiatorAddress( address_policy, empty_address_with_type, minimum_rotation_time, maximum_rotation_time); } } void bluetooth::shim::ACL_Disconnect(uint16_t handle, bool is_classic, void bluetooth::shim::ACL_Disconnect(uint16_t handle, bool is_classic, Loading
system/stack/btm/btm_ble_gap.cc +2 −1 Original line number Original line Diff line number Diff line Loading @@ -705,7 +705,8 @@ bool BTM_BleConfigPrivacy(bool privacy_mode) { GAP_BleAttrDBUpdate(GATT_UUID_GAP_CENTRAL_ADDR_RESOL, &gap_ble_attr_value); GAP_BleAttrDBUpdate(GATT_UUID_GAP_CENTRAL_ADDR_RESOL, &gap_ble_attr_value); if (bluetooth::shim::is_gd_acl_enabled()) { if (bluetooth::shim::is_gd_acl_enabled() || bluetooth::shim::is_gd_l2cap_enabled()) { bluetooth::shim::ACL_ConfigureLePrivacy(privacy_mode); bluetooth::shim::ACL_ConfigureLePrivacy(privacy_mode); } } return true; return true; Loading