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

Commit 233c4d97 authored by Hansong Zhang's avatar Hansong Zhang
Browse files

Wire up SetChannelTxPriority

Test: cert/run
Tag: #gd-refactor
Bug: 141555841
Change-Id: Iceb6559d7468a886d3720038f172dce6297016d3
parent dd11ff18
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -171,6 +171,10 @@ void Link::SendConnectionRequest(Psm psm, Cid local_cid,
  }
}

void Link::SetChannelTxPriority(Cid local_cid, bool high_priority) {
  data_pipeline_manager_.SetChannelTxPriority(local_cid, high_priority);
}

void Link::SetPendingDynamicChannels(std::list<Psm> psm_list,
                                     std::list<Link::PendingDynamicChannelConnection> callback_list) {
  ASSERT(psm_list.size() == callback_list.size());
+1 −0
Original line number Diff line number Diff line
@@ -106,6 +106,7 @@ class Link : public l2cap::internal::ILink, public hci::acl_manager::ConnectionM
  virtual void SendConnectionRequest(Psm psm, Cid local_cid);
  virtual void SendConnectionRequest(Psm psm, Cid local_cid,
                                     PendingDynamicChannelConnection pending_dynamic_channel_connection);
  void SetChannelTxPriority(Cid local_cid, bool high_priority) override;

  // When a Link is established, LinkManager notifies pending dynamic channels to connect
  virtual void SetPendingDynamicChannels(std::list<Psm> psm_list,
+5 −0
Original line number Diff line number Diff line
@@ -42,5 +42,10 @@ DynamicChannel::GetQueueUpEnd() const {
Cid DynamicChannel::HACK_GetRemoteCid() {
  return impl_->GetRemoteCid();
}

void DynamicChannel::HACK_SetChannelTxPriority(bool high_priority) {
  return impl_->SetChannelTxPriority(high_priority);
}

}  // namespace l2cap
}  // namespace bluetooth
+6 −0
Original line number Diff line number Diff line
@@ -72,6 +72,12 @@ class DynamicChannel {

  Cid HACK_GetRemoteCid();

  /**
   * Used by A2dp software encoding to prioritize Tx of this channel
   * @param high_priority
   */
  void HACK_SetChannelTxPriority(bool high_priority);

 private:
  std::shared_ptr<l2cap::internal::DynamicChannelImpl> impl_;
  os::Handler* l2cap_handler_;
+6 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ void DataPipelineManager::AttachChannel(Cid cid, std::shared_ptr<ChannelImpl> ch
void DataPipelineManager::DetachChannel(Cid cid) {
  ASSERT(sender_map_.find(cid) != sender_map_.end());
  sender_map_.erase(cid);
  scheduler_->SetChannelTxPriority(cid, false);
}

DataController* DataPipelineManager::GetDataController(Cid cid) {
@@ -55,6 +56,11 @@ void DataPipelineManager::UpdateClassicConfiguration(Cid cid, classic::internal:
  sender_map_.find(cid)->second.UpdateClassicConfiguration(config);
}

void DataPipelineManager::SetChannelTxPriority(Cid cid, bool high_priority) {
  ASSERT(sender_map_.find(cid) != sender_map_.end());
  scheduler_->SetChannelTxPriority(cid, high_priority);
}

}  // namespace internal
}  // namespace l2cap
}  // namespace bluetooth
Loading