Loading system/gd/hci/acl_manager.cc +8 −0 Original line number Diff line number Diff line Loading @@ -187,6 +187,14 @@ LeAddressManager* AclManager::GetLeAddressManager() { return pimpl_->le_impl_->le_address_manager_; } uint16_t AclManager::HACK_GetHandle(Address address) { return pimpl_->classic_impl_->HACK_get_handle(address); } uint16_t AclManager::HACK_GetLeHandle(Address address) { return pimpl_->le_impl_->HACK_get_handle(address); } void AclManager::ListDependencies(ModuleList* list) { list->add<HciLayer>(); list->add<Controller>(); Loading system/gd/hci/acl_manager.h +7 −0 Original line number Diff line number Diff line Loading @@ -35,10 +35,14 @@ namespace bluetooth { namespace security { class SecurityModule; } namespace shim { class Btm; } namespace hci { class AclManager : public Module { friend class bluetooth::shim::Btm; public: AclManager(); // NOTE: It is necessary to forward declare a default destructor that overrides the base class one, because Loading Loading @@ -95,6 +99,9 @@ class AclManager : public Module { std::string ToString() const override; private: virtual uint16_t HACK_GetHandle(const Address address); virtual uint16_t HACK_GetLeHandle(const Address address); struct impl; std::unique_ptr<impl> pimpl_; Loading system/gd/hci/acl_manager/classic_impl.h +9 −0 Original line number Diff line number Diff line Loading @@ -520,6 +520,15 @@ struct classic_impl : public DisconnectorForLe, public security::ISecurityManage security_manager_->RegisterCallbackListener(this, handler_); } uint16_t HACK_get_handle(Address address) { for (auto it = acl_connections_.begin(); it != acl_connections_.end(); it++) { if (it->second.address_with_type_.GetAddress() == address) { return it->first; } } return 0xFFFF; } HciLayer* hci_layer_ = nullptr; Controller* controller_ = nullptr; RoundRobinScheduler* round_robin_scheduler_ = nullptr; Loading system/gd/hci/acl_manager/le_impl.h +13 −3 Original line number Diff line number Diff line Loading @@ -34,11 +34,12 @@ namespace acl_manager { using common::BindOnce; struct le_acl_connection { le_acl_connection(AddressWithType address_with_type, AclConnection::QueueDownEnd* queue_down_end, os::Handler* handler) : assembler_(address_with_type, queue_down_end, handler) {} le_acl_connection( AddressWithType address_with_type, AclConnection::QueueDownEnd* queue_down_end, os::Handler* handler) : assembler_(address_with_type, queue_down_end, handler), address_with_type_(address_with_type) {} ~le_acl_connection() = default; struct acl_manager::assembler assembler_; AddressWithType address_with_type_; LeConnectionManagementCallbacks* le_connection_management_callbacks_ = nullptr; }; Loading Loading @@ -393,6 +394,15 @@ struct le_impl : public bluetooth::hci::LeAddressManagerCallback { le_address_manager_->AckResume(this); } uint16_t HACK_get_handle(Address address) { for (auto it = le_acl_connections_.begin(); it != le_acl_connections_.end(); it++) { if (it->second.address_with_type_.GetAddress() == address) { return it->first; } } return 0xFFFF; } static constexpr uint16_t kMinimumCeLength = 0x0002; static constexpr uint16_t kMaximumCeLength = 0x0C00; HciLayer* hci_layer_ = nullptr; Loading system/main/shim/btm.cc +10 −0 Original line number Diff line number Diff line Loading @@ -818,3 +818,13 @@ bool bluetooth::shim::Btm::RemoveBond(const RawAddress& bd_addr) { security_manager->RemoveBond(ToAddressWithType(bd_addr, BLE_ADDR_PUBLIC)); return true; } uint16_t bluetooth::shim::Btm::GetAclHandle(const RawAddress& remote_bda, tBT_TRANSPORT transport) { auto acl_manager = bluetooth::shim::GetAclManager(); if (transport == BT_TRANSPORT_BR_EDR) { return acl_manager->HACK_GetHandle(ToGdAddress(remote_bda)); } else { return acl_manager->HACK_GetLeHandle(ToGdAddress(remote_bda)); } } Loading
system/gd/hci/acl_manager.cc +8 −0 Original line number Diff line number Diff line Loading @@ -187,6 +187,14 @@ LeAddressManager* AclManager::GetLeAddressManager() { return pimpl_->le_impl_->le_address_manager_; } uint16_t AclManager::HACK_GetHandle(Address address) { return pimpl_->classic_impl_->HACK_get_handle(address); } uint16_t AclManager::HACK_GetLeHandle(Address address) { return pimpl_->le_impl_->HACK_get_handle(address); } void AclManager::ListDependencies(ModuleList* list) { list->add<HciLayer>(); list->add<Controller>(); Loading
system/gd/hci/acl_manager.h +7 −0 Original line number Diff line number Diff line Loading @@ -35,10 +35,14 @@ namespace bluetooth { namespace security { class SecurityModule; } namespace shim { class Btm; } namespace hci { class AclManager : public Module { friend class bluetooth::shim::Btm; public: AclManager(); // NOTE: It is necessary to forward declare a default destructor that overrides the base class one, because Loading Loading @@ -95,6 +99,9 @@ class AclManager : public Module { std::string ToString() const override; private: virtual uint16_t HACK_GetHandle(const Address address); virtual uint16_t HACK_GetLeHandle(const Address address); struct impl; std::unique_ptr<impl> pimpl_; Loading
system/gd/hci/acl_manager/classic_impl.h +9 −0 Original line number Diff line number Diff line Loading @@ -520,6 +520,15 @@ struct classic_impl : public DisconnectorForLe, public security::ISecurityManage security_manager_->RegisterCallbackListener(this, handler_); } uint16_t HACK_get_handle(Address address) { for (auto it = acl_connections_.begin(); it != acl_connections_.end(); it++) { if (it->second.address_with_type_.GetAddress() == address) { return it->first; } } return 0xFFFF; } HciLayer* hci_layer_ = nullptr; Controller* controller_ = nullptr; RoundRobinScheduler* round_robin_scheduler_ = nullptr; Loading
system/gd/hci/acl_manager/le_impl.h +13 −3 Original line number Diff line number Diff line Loading @@ -34,11 +34,12 @@ namespace acl_manager { using common::BindOnce; struct le_acl_connection { le_acl_connection(AddressWithType address_with_type, AclConnection::QueueDownEnd* queue_down_end, os::Handler* handler) : assembler_(address_with_type, queue_down_end, handler) {} le_acl_connection( AddressWithType address_with_type, AclConnection::QueueDownEnd* queue_down_end, os::Handler* handler) : assembler_(address_with_type, queue_down_end, handler), address_with_type_(address_with_type) {} ~le_acl_connection() = default; struct acl_manager::assembler assembler_; AddressWithType address_with_type_; LeConnectionManagementCallbacks* le_connection_management_callbacks_ = nullptr; }; Loading Loading @@ -393,6 +394,15 @@ struct le_impl : public bluetooth::hci::LeAddressManagerCallback { le_address_manager_->AckResume(this); } uint16_t HACK_get_handle(Address address) { for (auto it = le_acl_connections_.begin(); it != le_acl_connections_.end(); it++) { if (it->second.address_with_type_.GetAddress() == address) { return it->first; } } return 0xFFFF; } static constexpr uint16_t kMinimumCeLength = 0x0002; static constexpr uint16_t kMaximumCeLength = 0x0C00; HciLayer* hci_layer_ = nullptr; Loading
system/main/shim/btm.cc +10 −0 Original line number Diff line number Diff line Loading @@ -818,3 +818,13 @@ bool bluetooth::shim::Btm::RemoveBond(const RawAddress& bd_addr) { security_manager->RemoveBond(ToAddressWithType(bd_addr, BLE_ADDR_PUBLIC)); return true; } uint16_t bluetooth::shim::Btm::GetAclHandle(const RawAddress& remote_bda, tBT_TRANSPORT transport) { auto acl_manager = bluetooth::shim::GetAclManager(); if (transport == BT_TRANSPORT_BR_EDR) { return acl_manager->HACK_GetHandle(ToGdAddress(remote_bda)); } else { return acl_manager->HACK_GetLeHandle(ToGdAddress(remote_bda)); } }