Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6973eeb3 authored by Martin Brabham's avatar Martin Brabham
Browse files

SM: Refine channel connect logic

If the ACL is active then we just hold the ACL on connect instead of attempting to reconnect ACL.

Bug: 145638034
Test: cert/run --host --test_filter=SecurityTest
Test: atest --host bluetooth_test_gd:SecurtityManagerChannel
Tag: #gd-refactor
Change-Id: I895ccb1bc4f81caf45e95703706f4a0b66eb93bf
parent d3bbf1d5
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -41,8 +41,11 @@ SecurityManagerChannel::~SecurityManagerChannel() {

void SecurityManagerChannel::Connect(hci::Address address) {
  ASSERT_LOG(l2cap_security_interface_ != nullptr, "L2cap Security Interface is null!");
  if (link_map_.find(address) != link_map_.end()) {
  auto entry = link_map_.find(address);
  if (entry != link_map_.end()) {
    LOG_WARN("Already connected to '%s'", address.ToString().c_str());
    entry->second->Hold();
    entry->second->EnsureAuthenticated();
    return;
  }
  l2cap_security_interface_->InitiateConnectionForSecurity(address);