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

Commit 915d90a7 authored by Martin Brabham's avatar Martin Brabham
Browse files

GD SMC: Only call Hold for outgoing Link

If we get a call for an incoming Link we do
not want to hold unless we want to do something with it.

Holding incoming connections can result in never Releasing

Bug: 162984360
Tag: #gd-refactor
Test: cert/run --host SecurityTest
Change-Id: I6607c79e7b3af77334fcc871c0bfe31406050978
parent 2c152b50
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -88,9 +88,9 @@ 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->Hold();
    link->EnsureAuthenticated();
    outgoing_pairing_remote_devices_.erase(remote);
  }