Loading system/gd/security/channel/security_manager_channel.cc +8 −2 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ void SecurityManagerChannel::Connect(hci::Address address) { return; } l2cap_security_interface_->InitiateConnectionForSecurity(address); outgoing_pairing_remote_devices_.insert(address); } void SecurityManagerChannel::Release(hci::Address address) { Loading @@ -61,6 +62,7 @@ void SecurityManagerChannel::Release(hci::Address address) { } void SecurityManagerChannel::Disconnect(hci::Address address) { outgoing_pairing_remote_devices_.erase(address); auto entry = link_map_.find(address); if (entry == link_map_.end()) { LOG_WARN("Unknown address '%s'", address.ToString().c_str()); Loading @@ -87,8 +89,12 @@ void SecurityManagerChannel::OnHciEventReceived(hci::EventPacketView packet) { void SecurityManagerChannel::OnLinkConnected(std::unique_ptr<l2cap::classic::LinkSecurityInterface> link) { // Multiple links possible? link->Hold(); auto remote = link->GetRemoteAddress(); if (outgoing_pairing_remote_devices_.count(remote) == 1) { link->EnsureAuthenticated(); link_map_.emplace(link->GetRemoteAddress(), std::move(link)); outgoing_pairing_remote_devices_.erase(remote); } link_map_.emplace(remote, std::move(link)); } void SecurityManagerChannel::OnLinkDisconnected(hci::Address address) { Loading system/gd/security/channel/security_manager_channel.h +1 −0 Original line number Diff line number Diff line Loading @@ -123,6 +123,7 @@ class SecurityManagerChannel : public l2cap::classic::LinkSecurityInterfaceListe os::Handler* handler_{nullptr}; l2cap::classic::SecurityInterface* l2cap_security_interface_{nullptr}; std::unordered_map<hci::Address, std::unique_ptr<l2cap::classic::LinkSecurityInterface>> link_map_; std::set<hci::Address> outgoing_pairing_remote_devices_; }; } // namespace channel Loading Loading
system/gd/security/channel/security_manager_channel.cc +8 −2 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ void SecurityManagerChannel::Connect(hci::Address address) { return; } l2cap_security_interface_->InitiateConnectionForSecurity(address); outgoing_pairing_remote_devices_.insert(address); } void SecurityManagerChannel::Release(hci::Address address) { Loading @@ -61,6 +62,7 @@ void SecurityManagerChannel::Release(hci::Address address) { } void SecurityManagerChannel::Disconnect(hci::Address address) { outgoing_pairing_remote_devices_.erase(address); auto entry = link_map_.find(address); if (entry == link_map_.end()) { LOG_WARN("Unknown address '%s'", address.ToString().c_str()); Loading @@ -87,8 +89,12 @@ void SecurityManagerChannel::OnHciEventReceived(hci::EventPacketView packet) { void SecurityManagerChannel::OnLinkConnected(std::unique_ptr<l2cap::classic::LinkSecurityInterface> link) { // Multiple links possible? link->Hold(); auto remote = link->GetRemoteAddress(); if (outgoing_pairing_remote_devices_.count(remote) == 1) { link->EnsureAuthenticated(); link_map_.emplace(link->GetRemoteAddress(), std::move(link)); outgoing_pairing_remote_devices_.erase(remote); } link_map_.emplace(remote, std::move(link)); } void SecurityManagerChannel::OnLinkDisconnected(hci::Address address) { Loading
system/gd/security/channel/security_manager_channel.h +1 −0 Original line number Diff line number Diff line Loading @@ -123,6 +123,7 @@ class SecurityManagerChannel : public l2cap::classic::LinkSecurityInterfaceListe os::Handler* handler_{nullptr}; l2cap::classic::SecurityInterface* l2cap_security_interface_{nullptr}; std::unordered_map<hci::Address, std::unique_ptr<l2cap::classic::LinkSecurityInterface>> link_map_; std::set<hci::Address> outgoing_pairing_remote_devices_; }; } // namespace channel Loading