From 96ed87bb6af12c60c99dbcc787acb11f9c6f023e Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Tue, 17 Nov 2020 15:05:15 -0800 Subject: [PATCH] Hci layer: Minor clean up Tag: #gd-refactor Bug: 141555841 Test: cert/run --host Change-Id: I5498e56285a6523d0ce3199777c5677e9fdf6bbc --- gd/hci/hci_layer.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gd/hci/hci_layer.cc b/gd/hci/hci_layer.cc index 176177763..6ccaf1434 100644 --- a/gd/hci/hci_layer.cc +++ b/gd/hci/hci_layer.cc @@ -182,7 +182,7 @@ struct HciLayer::impl { } void unregister_event(EventCode event) { - event_handlers_.erase(event_handlers_.find(event)); + event_handlers_.erase(event); } void register_le_meta_event(ContextualCallback handler) { @@ -421,7 +421,7 @@ void HciLayer::Start() { RegisterEventHandler(EventCode::COMMAND_COMPLETE, handler->BindOn(impl_, &impl::on_command_complete)); RegisterEventHandler(EventCode::COMMAND_STATUS, handler->BindOn(impl_, &impl::on_command_status)); RegisterLeMetaEventHandler(handler->BindOn(impl_, &impl::on_le_meta_event)); - if (bluetooth::common::InitFlags::GdAclEnabled()) { + if (bluetooth::common::InitFlags::GdAclEnabled() || bluetooth::common::InitFlags::GdL2capEnabled()) { RegisterEventHandler( EventCode::DISCONNECTION_COMPLETE, handler->BindOn(this, &HciLayer::on_disconnection_complete)); RegisterEventHandler( -- 2.11.0