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

Commit 7126c81a authored by Chris Manton's avatar Chris Manton
Browse files

legacy: Explicitly use bluetooth::shim::hci_layer_get_interface

Bug: 197150934
Tag: #refactor
Test: gd/cert/run

Change-Id: Ie2b0fb714d729cb02d728f2458d23aadf863064c
parent 6c493ac9
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -183,7 +183,5 @@ TEST_F(StackCycleTest, stack_init) {

  LOG_INFO("Initialized stack");

  ASSERT_EQ(1, mock_function_count_map["set_data_cb"]);

  dump_mock_function_count_map();
}
+2 −1
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@
#include "check.h"
#include "hcimsgs.h"
#include "main/shim/controller.h"
#include "main/shim/hci_layer.h"
#include "main/shim/shim.h"
#include "osi/include/future.h"
#include "osi/include/properties.h"
@@ -827,7 +828,7 @@ static const controller_t* controller_get_interface_legacy() {
  if (!loaded) {
    loaded = true;

    local_hci = hci_layer_get_interface();
    local_hci = bluetooth::shim::hci_layer_get_interface();
    packet_factory = hci_packet_factory_get_interface();
    packet_parser = hci_packet_parser_get_interface();
  }
+2 −1
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@
#include "btu.h"
#include "device/include/interop.h"
#include "hci_layer.h"
#include "main/shim/hci_layer.h"
#include "osi/include/log.h"
#include "osi/include/osi.h"
#include "shim/hci_layer.h"
@@ -76,7 +77,7 @@ static void post_to_main_message_loop(const base::Location& from_here,
}

void bte_main_init(void) {
  hci = hci_layer_get_interface();
  hci = bluetooth::shim::hci_layer_get_interface();
  if (!hci) {
    LOG_ERROR("%s could not get hci layer interface.", __func__);
    return;
+2 −1
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@
#include "hcimsgs.h"
#include "main/shim/btm_api.h"
#include "main/shim/controller.h"
#include "main/shim/hci_layer.h"
#include "main/shim/shim.h"
#include "osi/include/osi.h"
#include "stack/btm/btm_ble_int.h"
@@ -662,7 +663,7 @@ tBTM_STATUS BTM_EnableTestMode(void) {
  }

  /* mask off all of event from controller */
  hci_layer_get_interface()->transmit_command(
  bluetooth::shim::hci_layer_get_interface()->transmit_command(
      hci_packet_factory_get_interface()->make_set_event_mask(
          (const bt_event_mask_t*)("\x00\x00\x00\x00\x00\x00\x00\x00")),
      NULL, NULL, NULL);
+3 −2
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
#include "btif/include/btif_config.h"
#include "common/metrics.h"
#include "device/include/controller.h"
#include "main/shim/hci_layer.h"
#include "osi/include/log.h"
#include "stack/include/acl_hci_link_interface.h"
#include "stack/include/ble_acl_interface.h"
@@ -734,7 +735,7 @@ void btu_hcif_send_cmd(UNUSED_ATTR uint8_t controller_id, BT_HDR* p_buf) {
  btu_hcif_log_command_metrics(opcode, stream,
                               android::bluetooth::hci::STATUS_UNKNOWN, false);

  hci_layer_get_interface()->transmit_command(
  bluetooth::shim::hci_layer_get_interface()->transmit_command(
      p_buf, btu_hcif_command_complete_evt, btu_hcif_command_status_evt,
      vsc_callback);
}
@@ -915,7 +916,7 @@ void btu_hcif_send_cmd_with_cb(const base::Location& posted_from,
  cb_wrapper->cb = std::move(cb);
  cb_wrapper->posted_from = posted_from;

  hci_layer_get_interface()->transmit_command(
  bluetooth::shim::hci_layer_get_interface()->transmit_command(
      p, btu_hcif_command_complete_evt_with_cb,
      btu_hcif_command_status_evt_with_cb, (void*)cb_wrapper);
}