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

Commit 533e87d2 authored by Chris Manton's avatar Chris Manton
Browse files

gd: Register close callback prior to channel acquire

The underlying implementation enforces this with ASSERT

Bug: 144170448
Test: CtsVerifier HID host test
Change-Id: I65e023e4a523deb9a8aa8edd41a3592a600ffb8e
parent c3f0bc22
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -86,9 +86,9 @@ void ClassicPairingHandler::OnConnectionOpen(std::unique_ptr<l2cap::classic::Fix
  ASSERT(fixed_channel_ == nullptr);
  fixed_channel_ = std::move(fixed_channel);
  ASSERT(fixed_channel_->GetDevice() == GetRecord()->GetPseudoAddress().GetAddress());
  fixed_channel_->Acquire();
  fixed_channel_->RegisterOnCloseCallback(
      security_handler_, common::BindOnce(&ClassicPairingHandler::OnConnectionClose, common::Unretained(this)));
  fixed_channel_->Acquire();
}

void ClassicPairingHandler::OnConnectionFail(l2cap::classic::FixedChannelManager::ConnectionResult result) {