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

Commit 54b4964f authored by Chris Manton's avatar Chris Manton
Browse files

Add information request after acl connect

The 2 information requests are optional, but convention
by legacy android stack and other devices I've tested against
send these commands after acl connection.

Bug: 143697964
Test: Verified on actual device with wireshark

Change-Id: Idd651ac30e8d843c88105f4145756320c0f68902
parent 320c782e
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -78,6 +78,10 @@ void Link::SendDisconnectionRequest(Cid local_cid, Cid remote_cid) {
  signalling_manager_.SendDisconnectionRequest(local_cid, remote_cid);
}

void Link::SendInformationRequest(InformationRequestInfoType type) {
  signalling_manager_.SendInformationRequest(type);
}

std::shared_ptr<DynamicChannelImpl> Link::AllocateDynamicChannel(Psm psm, Cid remote_cid,
                                                                 SecurityPolicy security_policy) {
  auto channel = dynamic_channel_allocator_.AllocateChannel(psm, remote_cid, security_policy);
+2 −0
Original line number Diff line number Diff line
@@ -67,6 +67,8 @@ class Link {

  virtual void SendConnectionRequest(Psm psm, Cid local_cid);

  virtual void SendInformationRequest(InformationRequestInfoType type);

  virtual void SendDisconnectionRequest(Cid local_cid, Cid remote_cid);

  virtual std::shared_ptr<DynamicChannelImpl> AllocateDynamicChannel(Psm psm, Cid remote_cid,
+4 −0
Original line number Diff line number Diff line
@@ -120,6 +120,10 @@ void LinkManager::OnConnectSuccess(std::unique_ptr<hci::AclConnection> acl_conne
                     std::make_unique<l2cap::internal::Fifo>(link_queue_up_end, l2cap_handler_), parameter_provider_,
                     dynamic_channel_service_manager_, fixed_channel_service_manager_);
  auto* link = GetLink(device);
  ASSERT(link != nullptr);
  link->SendInformationRequest(InformationRequestInfoType::EXTENDED_FEATURES_SUPPORTED);
  link->SendInformationRequest(InformationRequestInfoType::FIXED_CHANNELS_SUPPORTED);

  // Allocate and distribute channels for all registered fixed channel services
  auto fixed_channel_services = fixed_channel_service_manager_->GetRegisteredServices();
  for (auto& fixed_channel_service : fixed_channel_services) {