Loading system/gd/l2cap/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ filegroup { "le/internal/fixed_channel_service_manager_impl.cc", "le/internal/link.cc", "le/internal/link_manager.cc", "le/internal/signalling_manager.cc", "le/l2cap_le_module.cc", ], } Loading system/gd/l2cap/classic/internal/link.cc +5 −3 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ void Link::Disconnect() { std::shared_ptr<FixedChannelImpl> Link::AllocateFixedChannel(Cid cid, SecurityPolicy security_policy) { auto channel = fixed_channel_allocator_.AllocateChannel(cid, security_policy); data_pipeline_manager_.AttachChannel(cid, channel); data_pipeline_manager_.AttachChannel(cid, channel, l2cap::internal::DataPipelineManager::ChannelMode::BASIC); return channel; } Loading Loading @@ -91,7 +91,8 @@ std::shared_ptr<l2cap::internal::DynamicChannelImpl> Link::AllocateDynamicChanne SecurityPolicy security_policy) { auto channel = dynamic_channel_allocator_.AllocateChannel(psm, remote_cid, security_policy); if (channel != nullptr) { data_pipeline_manager_.AttachChannel(channel->GetCid(), channel); data_pipeline_manager_.AttachChannel(channel->GetCid(), channel, l2cap::internal::DataPipelineManager::ChannelMode::BASIC); RefreshRefCount(); } channel->local_initiated_ = false; Loading @@ -102,7 +103,8 @@ std::shared_ptr<l2cap::internal::DynamicChannelImpl> Link::AllocateReservedDynam Cid reserved_cid, Psm psm, Cid remote_cid, SecurityPolicy security_policy) { auto channel = dynamic_channel_allocator_.AllocateReservedChannel(reserved_cid, psm, remote_cid, security_policy); if (channel != nullptr) { data_pipeline_manager_.AttachChannel(channel->GetCid(), channel); data_pipeline_manager_.AttachChannel(channel->GetCid(), channel, l2cap::internal::DataPipelineManager::ChannelMode::BASIC); RefreshRefCount(); } channel->local_initiated_ = true; Loading system/gd/l2cap/classic/internal/signalling_manager.cc +2 −1 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ void ClassicSignallingManager::OnCommandReject(CommandRejectView command_reject_ LOG_WARN("Unknown command reject"); return; } alarm_.Cancel(); handle_send_next_command(); LOG_INFO("Command rejected"); Loading Loading @@ -214,6 +215,7 @@ void ClassicSignallingManager::OnConnectionResponse(SignalId signal_id, Cid remo handle_send_next_command(); return; } alarm_.Cancel(); if (result != ConnectionResponseResult::SUCCESS) { handle_send_next_command(); return; Loading @@ -225,7 +227,6 @@ void ClassicSignallingManager::OnConnectionResponse(SignalId signal_id, Cid remo handle_send_next_command(); return; } alarm_.Cancel(); auto& configuration_state = channel_configuration_[new_channel->GetCid()]; auto initial_config = link_->GetConfigurationForInitialConfiguration(new_channel->GetCid()); Loading system/gd/l2cap/internal/data_pipeline_manager.cc +3 −2 Original line number Diff line number Diff line Loading @@ -20,16 +20,17 @@ #include "l2cap/internal/channel_impl.h" #include "l2cap/internal/data_controller.h" #include "l2cap/internal/data_pipeline_manager.h" #include "l2cap/internal/sender.h" #include "os/log.h" namespace bluetooth { namespace l2cap { namespace internal { void DataPipelineManager::AttachChannel(Cid cid, std::shared_ptr<ChannelImpl> channel) { void DataPipelineManager::AttachChannel(Cid cid, std::shared_ptr<ChannelImpl> channel, ChannelMode mode) { ASSERT(sender_map_.find(cid) == sender_map_.end()); sender_map_.emplace(std::piecewise_construct, std::forward_as_tuple(cid), std::forward_as_tuple(handler_, link_, scheduler_.get(), channel)); std::forward_as_tuple(handler_, link_, scheduler_.get(), channel, mode)); } void DataPipelineManager::DetachChannel(Cid cid) { Loading system/gd/l2cap/internal/data_pipeline_manager.h +3 −1 Original line number Diff line number Diff line Loading @@ -59,7 +59,9 @@ class DataPipelineManager { : handler_(handler), link_(link), scheduler_(std::make_unique<Fifo>(this, link_queue_up_end, handler)), receiver_(link_queue_up_end, handler, this) {} virtual void AttachChannel(Cid cid, std::shared_ptr<ChannelImpl> channel); using ChannelMode = Sender::ChannelMode; virtual void AttachChannel(Cid cid, std::shared_ptr<ChannelImpl> channel, ChannelMode mode); virtual void DetachChannel(Cid cid); virtual DataController* GetDataController(Cid cid); virtual void OnPacketSent(Cid cid); Loading Loading
system/gd/l2cap/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ filegroup { "le/internal/fixed_channel_service_manager_impl.cc", "le/internal/link.cc", "le/internal/link_manager.cc", "le/internal/signalling_manager.cc", "le/l2cap_le_module.cc", ], } Loading
system/gd/l2cap/classic/internal/link.cc +5 −3 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ void Link::Disconnect() { std::shared_ptr<FixedChannelImpl> Link::AllocateFixedChannel(Cid cid, SecurityPolicy security_policy) { auto channel = fixed_channel_allocator_.AllocateChannel(cid, security_policy); data_pipeline_manager_.AttachChannel(cid, channel); data_pipeline_manager_.AttachChannel(cid, channel, l2cap::internal::DataPipelineManager::ChannelMode::BASIC); return channel; } Loading Loading @@ -91,7 +91,8 @@ std::shared_ptr<l2cap::internal::DynamicChannelImpl> Link::AllocateDynamicChanne SecurityPolicy security_policy) { auto channel = dynamic_channel_allocator_.AllocateChannel(psm, remote_cid, security_policy); if (channel != nullptr) { data_pipeline_manager_.AttachChannel(channel->GetCid(), channel); data_pipeline_manager_.AttachChannel(channel->GetCid(), channel, l2cap::internal::DataPipelineManager::ChannelMode::BASIC); RefreshRefCount(); } channel->local_initiated_ = false; Loading @@ -102,7 +103,8 @@ std::shared_ptr<l2cap::internal::DynamicChannelImpl> Link::AllocateReservedDynam Cid reserved_cid, Psm psm, Cid remote_cid, SecurityPolicy security_policy) { auto channel = dynamic_channel_allocator_.AllocateReservedChannel(reserved_cid, psm, remote_cid, security_policy); if (channel != nullptr) { data_pipeline_manager_.AttachChannel(channel->GetCid(), channel); data_pipeline_manager_.AttachChannel(channel->GetCid(), channel, l2cap::internal::DataPipelineManager::ChannelMode::BASIC); RefreshRefCount(); } channel->local_initiated_ = true; Loading
system/gd/l2cap/classic/internal/signalling_manager.cc +2 −1 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ void ClassicSignallingManager::OnCommandReject(CommandRejectView command_reject_ LOG_WARN("Unknown command reject"); return; } alarm_.Cancel(); handle_send_next_command(); LOG_INFO("Command rejected"); Loading Loading @@ -214,6 +215,7 @@ void ClassicSignallingManager::OnConnectionResponse(SignalId signal_id, Cid remo handle_send_next_command(); return; } alarm_.Cancel(); if (result != ConnectionResponseResult::SUCCESS) { handle_send_next_command(); return; Loading @@ -225,7 +227,6 @@ void ClassicSignallingManager::OnConnectionResponse(SignalId signal_id, Cid remo handle_send_next_command(); return; } alarm_.Cancel(); auto& configuration_state = channel_configuration_[new_channel->GetCid()]; auto initial_config = link_->GetConfigurationForInitialConfiguration(new_channel->GetCid()); Loading
system/gd/l2cap/internal/data_pipeline_manager.cc +3 −2 Original line number Diff line number Diff line Loading @@ -20,16 +20,17 @@ #include "l2cap/internal/channel_impl.h" #include "l2cap/internal/data_controller.h" #include "l2cap/internal/data_pipeline_manager.h" #include "l2cap/internal/sender.h" #include "os/log.h" namespace bluetooth { namespace l2cap { namespace internal { void DataPipelineManager::AttachChannel(Cid cid, std::shared_ptr<ChannelImpl> channel) { void DataPipelineManager::AttachChannel(Cid cid, std::shared_ptr<ChannelImpl> channel, ChannelMode mode) { ASSERT(sender_map_.find(cid) == sender_map_.end()); sender_map_.emplace(std::piecewise_construct, std::forward_as_tuple(cid), std::forward_as_tuple(handler_, link_, scheduler_.get(), channel)); std::forward_as_tuple(handler_, link_, scheduler_.get(), channel, mode)); } void DataPipelineManager::DetachChannel(Cid cid) { Loading
system/gd/l2cap/internal/data_pipeline_manager.h +3 −1 Original line number Diff line number Diff line Loading @@ -59,7 +59,9 @@ class DataPipelineManager { : handler_(handler), link_(link), scheduler_(std::make_unique<Fifo>(this, link_queue_up_end, handler)), receiver_(link_queue_up_end, handler, this) {} virtual void AttachChannel(Cid cid, std::shared_ptr<ChannelImpl> channel); using ChannelMode = Sender::ChannelMode; virtual void AttachChannel(Cid cid, std::shared_ptr<ChannelImpl> channel, ChannelMode mode); virtual void DetachChannel(Cid cid); virtual DataController* GetDataController(Cid cid); virtual void OnPacketSent(Cid cid); Loading