Loading system/gd/hci/acl_manager.cc +8 −0 Original line number Diff line number Diff line Loading @@ -297,6 +297,14 @@ void AclManager::SetSecurityModule(security::SecurityModule* security_module) { CallOn(pimpl_->classic_impl_, &classic_impl::set_security_module, security_module); } void AclManager::OnClassicSuspendInitiatedDisconnect(uint16_t handle, ErrorCode reason) { CallOn(pimpl_->classic_impl_, &classic_impl::on_classic_disconnect, handle, reason); } void AclManager::OnLeSuspendInitiatedDisconnect(uint16_t handle, ErrorCode reason) { CallOn(pimpl_->le_impl_, &le_impl::on_le_disconnect, handle, reason); } LeAddressManager* AclManager::GetLeAddressManager() { return pimpl_->le_impl_->le_address_manager_; } Loading system/gd/hci/acl_manager.h +4 −0 Original line number Diff line number Diff line Loading @@ -133,6 +133,10 @@ public: virtual LeAddressManager* GetLeAddressManager(); // Virtual ACL disconnect emitted during suspend. virtual void OnClassicSuspendInitiatedDisconnect(uint16_t handle, ErrorCode reason); virtual void OnLeSuspendInitiatedDisconnect(uint16_t handle, ErrorCode reason); static const ModuleFactory Factory; protected: Loading system/main/shim/acl.cc +12 −12 Original line number Diff line number Diff line Loading @@ -862,15 +862,15 @@ struct shim::legacy::Acl::impl { } // Since this is a suspend disconnect, we immediately also call // |OnDisconnection| without waiting for it to happen. We want the stack // to clean up ahead of the link layer (since we will mask away that // event). The reason we do this in a separate loop is that this will also // remove the handle from the connection map. // |OnClassicSuspendInitiatedDisconnect| without waiting for it to happen. // We want the stack to clean up ahead of the link layer (since we will mask // away that event). The reason we do this in a separate loop is that this // will also remove the handle from the connection map. for (auto& handle : disconnect_handles) { auto found = handle_to_classic_connection_map_.find(handle); if (found != handle_to_classic_connection_map_.end()) { found->second->OnDisconnection( hci::ErrorCode::CONNECTION_TERMINATED_BY_LOCAL_HOST); GetAclManager()->OnClassicSuspendInitiatedDisconnect( found->first, hci::ErrorCode::CONNECTION_TERMINATED_BY_LOCAL_HOST); } } Loading @@ -896,15 +896,15 @@ struct shim::legacy::Acl::impl { } // Since this is a suspend disconnect, we immediately also call // |OnDisconnection| without waiting for it to happen. We want the stack // to clean up ahead of the link layer (since we will mask away that // event). The reason we do this in a separate loop is that this will also // remove the handle from the connection map. // |OnLeSuspendInitiatedDisconnect| without waiting for it to happen. We // want the stack to clean up ahead of the link layer (since we will mask // away that event). The reason we do this in a separate loop is that this // will also remove the handle from the connection map. for (auto& handle : disconnect_handles) { auto found = handle_to_le_connection_map_.find(handle); if (found != handle_to_le_connection_map_.end()) { found->second->OnDisconnection( hci::ErrorCode::CONNECTION_TERMINATED_BY_LOCAL_HOST); GetAclManager()->OnLeSuspendInitiatedDisconnect( found->first, hci::ErrorCode::CONNECTION_TERMINATED_BY_LOCAL_HOST); } } promise.set_value(); Loading Loading
system/gd/hci/acl_manager.cc +8 −0 Original line number Diff line number Diff line Loading @@ -297,6 +297,14 @@ void AclManager::SetSecurityModule(security::SecurityModule* security_module) { CallOn(pimpl_->classic_impl_, &classic_impl::set_security_module, security_module); } void AclManager::OnClassicSuspendInitiatedDisconnect(uint16_t handle, ErrorCode reason) { CallOn(pimpl_->classic_impl_, &classic_impl::on_classic_disconnect, handle, reason); } void AclManager::OnLeSuspendInitiatedDisconnect(uint16_t handle, ErrorCode reason) { CallOn(pimpl_->le_impl_, &le_impl::on_le_disconnect, handle, reason); } LeAddressManager* AclManager::GetLeAddressManager() { return pimpl_->le_impl_->le_address_manager_; } Loading
system/gd/hci/acl_manager.h +4 −0 Original line number Diff line number Diff line Loading @@ -133,6 +133,10 @@ public: virtual LeAddressManager* GetLeAddressManager(); // Virtual ACL disconnect emitted during suspend. virtual void OnClassicSuspendInitiatedDisconnect(uint16_t handle, ErrorCode reason); virtual void OnLeSuspendInitiatedDisconnect(uint16_t handle, ErrorCode reason); static const ModuleFactory Factory; protected: Loading
system/main/shim/acl.cc +12 −12 Original line number Diff line number Diff line Loading @@ -862,15 +862,15 @@ struct shim::legacy::Acl::impl { } // Since this is a suspend disconnect, we immediately also call // |OnDisconnection| without waiting for it to happen. We want the stack // to clean up ahead of the link layer (since we will mask away that // event). The reason we do this in a separate loop is that this will also // remove the handle from the connection map. // |OnClassicSuspendInitiatedDisconnect| without waiting for it to happen. // We want the stack to clean up ahead of the link layer (since we will mask // away that event). The reason we do this in a separate loop is that this // will also remove the handle from the connection map. for (auto& handle : disconnect_handles) { auto found = handle_to_classic_connection_map_.find(handle); if (found != handle_to_classic_connection_map_.end()) { found->second->OnDisconnection( hci::ErrorCode::CONNECTION_TERMINATED_BY_LOCAL_HOST); GetAclManager()->OnClassicSuspendInitiatedDisconnect( found->first, hci::ErrorCode::CONNECTION_TERMINATED_BY_LOCAL_HOST); } } Loading @@ -896,15 +896,15 @@ struct shim::legacy::Acl::impl { } // Since this is a suspend disconnect, we immediately also call // |OnDisconnection| without waiting for it to happen. We want the stack // to clean up ahead of the link layer (since we will mask away that // event). The reason we do this in a separate loop is that this will also // remove the handle from the connection map. // |OnLeSuspendInitiatedDisconnect| without waiting for it to happen. We // want the stack to clean up ahead of the link layer (since we will mask // away that event). The reason we do this in a separate loop is that this // will also remove the handle from the connection map. for (auto& handle : disconnect_handles) { auto found = handle_to_le_connection_map_.find(handle); if (found != handle_to_le_connection_map_.end()) { found->second->OnDisconnection( hci::ErrorCode::CONNECTION_TERMINATED_BY_LOCAL_HOST); GetAclManager()->OnLeSuspendInitiatedDisconnect( found->first, hci::ErrorCode::CONNECTION_TERMINATED_BY_LOCAL_HOST); } } promise.set_value(); Loading