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

Commit 6e1b08e5 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "hci_layer: Remove unused Location parameter from send_data_upwards"...

Merge "hci_layer: Remove unused Location parameter from send_data_upwards" into main am: 8fcf0453 am: 16f38a62

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/3169197



Change-Id: I29587210d0397a4b4fb67aa49046be5d21e63849
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 205581e8 16f38a62
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@
#pragma once

#include <base/functional/callback.h>
#include <base/location.h>

#include "stack/include/bt_hdr.h"
#include "stack/include/bt_types.h"
@@ -51,7 +50,7 @@ typedef void (*command_status_cb)(uint8_t status, BT_HDR* command, void* context

typedef struct hci_t {
  // Set the callback that the HCI layer uses to send data upwards
  void (*set_data_cb)(base::Callback<void(const base::Location&, BT_HDR*)> send_data_cb);
  void (*set_data_cb)(base::Callback<void(BT_HDR*)> send_data_cb);

  // Send a command through the HCI layer
  void (*transmit_command)(const BT_HDR* command, command_complete_cb complete_callback,
+5 −5
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ constexpr size_t kBtHdrSize = sizeof(BT_HDR);
constexpr size_t kCommandLengthSize = sizeof(uint8_t);
constexpr size_t kCommandOpcodeSize = sizeof(uint16_t);

static base::Callback<void(const base::Location&, BT_HDR*)> send_data_upwards;
static base::Callback<void(BT_HDR*)> send_data_upwards;
static const packet_fragmenter_t* packet_fragmenter;

namespace {
@@ -142,14 +142,14 @@ static void event_callback(bluetooth::hci::EventView event_packet_view) {
  if (!send_data_upwards) {
    return;
  }
  send_data_upwards.Run(FROM_HERE, WrapPacketAndCopy(MSG_HC_TO_STACK_HCI_EVT, &event_packet_view));
  send_data_upwards.Run(WrapPacketAndCopy(MSG_HC_TO_STACK_HCI_EVT, &event_packet_view));
}

static void subevent_callback(bluetooth::hci::LeMetaEventView le_meta_event_view) {
  if (!send_data_upwards) {
    return;
  }
  send_data_upwards.Run(FROM_HERE, WrapPacketAndCopy(MSG_HC_TO_STACK_HCI_EVT, &le_meta_event_view));
  send_data_upwards.Run(WrapPacketAndCopy(MSG_HC_TO_STACK_HCI_EVT, &le_meta_event_view));
}

void OnTransmitPacketCommandComplete(command_complete_cb complete_callback, void* context,
@@ -289,7 +289,7 @@ using bluetooth::common::Bind;
using bluetooth::common::BindOnce;
using bluetooth::common::Unretained;

static void set_data_cb(base::Callback<void(const base::Location&, BT_HDR*)> send_data_cb) {
static void set_data_cb(base::Callback<void(BT_HDR*)> send_data_cb) {
  send_data_upwards = std::move(send_data_cb);
}

@@ -321,7 +321,7 @@ static void dispatch_reassembled(BT_HDR* packet) {
                   "assert failed: (packet->event & MSG_EVT_MASK) == "
                   "MSG_HC_TO_STACK_HCI_ISO");
  log::assert_that(!send_data_upwards.is_null(), "assert failed: !send_data_upwards.is_null()");
  send_data_upwards.Run(FROM_HERE, packet);
  send_data_upwards.Run(packet);
}

static const packet_fragmenter_callbacks_t packet_fragmenter_callbacks = {transmit_fragment,
+2 −2
Original line number Diff line number Diff line
@@ -31,9 +31,9 @@ static const hci_t* hci;

void btu_hci_msg_process(BT_HDR* p_msg);

static void post_to_main_message_loop(const base::Location& from_here, BT_HDR* p_msg) {
static void post_to_main_message_loop(BT_HDR* p_msg) {
  if (do_in_main_thread(base::Bind(&btu_hci_msg_process, p_msg)) != BT_STATUS_SUCCESS) {
    bluetooth::log::error(": do_in_main_thread failed from {}", from_here.ToString());
    bluetooth::log::error("do_in_main_thread failed");
  }
}

+1 −1
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ public:
static MockIsoInterface* iso_interface = nullptr;
static void SetMockIsoInterface(MockIsoInterface* interface) { iso_interface = interface; }

static void set_data_cb(base::Callback<void(const base::Location&, BT_HDR*)> /* send_data_cb */) {
static void set_data_cb(base::Callback<void(BT_HDR*)> /* send_data_cb */) {
  FAIL() << __func__ << " should never be called";
}