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

Commit 11648486 authored by Myles Watson's avatar Myles Watson
Browse files

HCI shim: Remove unused queues

Bug: 283254594
Test: presubmit
Change-Id: Ibc13e101a67e9419c177d2b34c7b8d90bd981b20
parent 8e1f210e
Loading
Loading
Loading
Loading
+0 −29
Original line number Diff line number Diff line
@@ -267,17 +267,12 @@ static bool event_already_registered_in_le_scanning_manager(
}  // namespace

namespace cpp {
bluetooth::common::BidiQueueEnd<bluetooth::hci::AclBuilder,
                                bluetooth::hci::AclView>* hci_queue_end =
    nullptr;
bluetooth::common::BidiQueueEnd<bluetooth::hci::ScoBuilder,
                                bluetooth::hci::ScoView>* hci_sco_queue_end =
    nullptr;
bluetooth::common::BidiQueueEnd<bluetooth::hci::IsoBuilder,
                                bluetooth::hci::IsoView>* hci_iso_queue_end =
    nullptr;
static bluetooth::os::EnqueueBuffer<bluetooth::hci::AclBuilder>* pending_data =
    nullptr;
static bluetooth::os::EnqueueBuffer<bluetooth::hci::IsoBuilder>*
    pending_iso_data = nullptr;
static bluetooth::os::EnqueueBuffer<bluetooth::hci::ScoBuilder>*
@@ -490,11 +485,6 @@ static void register_for_iso() {
}

static void on_shutting_down() {
  if (pending_data != nullptr) {
    pending_data->Clear();
    delete pending_data;
    pending_data = nullptr;
  }
  if (pending_sco_data != nullptr) {
    pending_sco_data->Clear();
    delete pending_sco_data;
@@ -505,25 +495,6 @@ static void on_shutting_down() {
    delete pending_iso_data;
    pending_iso_data = nullptr;
  }
  if (hci_queue_end != nullptr) {
    for (uint16_t event_code_raw = 0; event_code_raw < 0x100;
         event_code_raw++) {
      auto event_code = static_cast<bluetooth::hci::EventCode>(event_code_raw);
      if (!is_valid_event_code(event_code)) {
        continue;
      }
      if (event_already_registered_in_hci_layer(event_code)) {
        continue;
      } else if (event_already_registered_in_le_advertising_manager(
                     event_code)) {
        continue;
      } else if (event_already_registered_in_le_scanning_manager(event_code)) {
        continue;
      }
      bluetooth::shim::GetHciLayer()->UnregisterEventHandler(event_code);
    }
    hci_queue_end = nullptr;
  }
  if (hci_sco_queue_end != nullptr) {
    hci_sco_queue_end->UnregisterDequeue();
    hci_sco_queue_end = nullptr;