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

Commit d4e47054 authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

Get rid of the redundant shim interfaces

It was agred to expose gd types into the system/bt/main folder.
All the interfaces already use pimpl pattern to make them testable.
Thus there is no need for the I* shim interfaces.

Test: updated tests
Bug: 149757450
Change-Id: I9662f9ab48c61b764e4df082da1a73483cb0b2b9
parent 2d078ae8
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -140,6 +140,7 @@ cc_test {
    header_libs: ["libbluetooth_headers"],
    header_libs: ["libbluetooth_headers"],
    shared_libs: [
    shared_libs: [
        "libaaudio",
        "libaaudio",
        "android.hardware.bluetooth@1.0",
        "android.hardware.bluetooth.a2dp@1.0",
        "android.hardware.bluetooth.a2dp@1.0",
        "android.hardware.bluetooth.audio@2.0",
        "android.hardware.bluetooth.audio@2.0",
        "libfmq",
        "libfmq",
@@ -174,7 +175,6 @@ cc_test {
        "libbluetooth-types",
        "libbluetooth-types",
        "libosi",
        "libosi",
        "libbt-protos-lite",
        "libbt-protos-lite",
        "libbluetooth-gd-stub",
   ],
   ],
    whole_static_libs: [
    whole_static_libs: [
        "libbtif",
        "libbtif",
+3 −3
Original line number Original line Diff line number Diff line
@@ -22,9 +22,9 @@
#include <stdint.h>
#include <stdint.h>


#include "device_features.h"
#include "device_features.h"
#include "hci_layer.h"
#include "hci/include/hci_layer.h"
#include "hci_packet_factory.h"
#include "hci/include/hci_packet_factory.h"
#include "hci_packet_parser.h"
#include "hci/include/hci_packet_parser.h"


static const char CONTROLLER_MODULE[] = "controller_module";
static const char CONTROLLER_MODULE[] = "controller_module";


+5 −4
Original line number Original line Diff line number Diff line
@@ -53,7 +53,7 @@ const uint8_t SCO_HOST_BUFFER_SIZE = 0xff;
#define BLE_SUPPORTED_FEATURES_SIZE 8
#define BLE_SUPPORTED_FEATURES_SIZE 8
#define MAX_LOCAL_SUPPORTED_CODECS_SIZE 8
#define MAX_LOCAL_SUPPORTED_CODECS_SIZE 8


static const hci_t* hci;
static const hci_t* local_hci;
static const hci_packet_factory_t* packet_factory;
static const hci_packet_factory_t* packet_factory;
static const hci_packet_parser_t* packet_parser;
static const hci_packet_parser_t* packet_parser;


@@ -90,7 +90,8 @@ static bool simple_pairing_supported;
static bool secure_connections_supported;
static bool secure_connections_supported;


#define AWAIT_COMMAND(command) \
#define AWAIT_COMMAND(command) \
  static_cast<BT_HDR*>(future_await(hci->transmit_command_futured(command)))
  static_cast<BT_HDR*>(        \
      future_await(local_hci->transmit_command_futured(command)))


// Module lifecycle functions
// Module lifecycle functions


@@ -589,7 +590,7 @@ const controller_t* bluetooth::legacy::controller_get_interface() {
  if (!loaded) {
  if (!loaded) {
    loaded = true;
    loaded = true;


    hci = hci_layer_get_interface();
    local_hci = hci_layer_get_interface();
    packet_factory = hci_packet_factory_get_interface();
    packet_factory = hci_packet_factory_get_interface();
    packet_parser = hci_packet_parser_get_interface();
    packet_parser = hci_packet_parser_get_interface();
  }
  }
@@ -609,7 +610,7 @@ const controller_t* controller_get_test_interface(
    const hci_t* hci_interface,
    const hci_t* hci_interface,
    const hci_packet_factory_t* packet_factory_interface,
    const hci_packet_factory_t* packet_factory_interface,
    const hci_packet_parser_t* packet_parser_interface) {
    const hci_packet_parser_t* packet_parser_interface) {
  hci = hci_interface;
  local_hci = hci_interface;
  packet_factory = packet_factory_interface;
  packet_factory = packet_factory_interface;
  packet_parser = packet_parser_interface;
  packet_parser = packet_parser_interface;
  return &interface;
  return &interface;
+0 −2
Original line number Original line Diff line number Diff line
@@ -35,7 +35,6 @@
#include "security/facade.h"
#include "security/facade.h"
#include "shim/advertising.h"
#include "shim/advertising.h"
#include "shim/connectability.h"
#include "shim/connectability.h"
#include "shim/controller.h"
#include "shim/discoverability.h"
#include "shim/discoverability.h"
#include "shim/dumpsys.h"
#include "shim/dumpsys.h"
#include "shim/hci_layer.h"
#include "shim/hci_layer.h"
@@ -108,7 +107,6 @@ class RootFacadeService : public ::bluetooth::facade::RootFacade::Service {
      case BluetoothModule::SHIM:
      case BluetoothModule::SHIM:
        modules.add<::bluetooth::shim::Advertising>();
        modules.add<::bluetooth::shim::Advertising>();
        modules.add<::bluetooth::shim::Connectability>();
        modules.add<::bluetooth::shim::Connectability>();
        modules.add<::bluetooth::shim::Controller>();
        modules.add<::bluetooth::shim::Discoverability>();
        modules.add<::bluetooth::shim::Discoverability>();
        modules.add<::bluetooth::shim::Dumpsys>();
        modules.add<::bluetooth::shim::Dumpsys>();
        modules.add<::bluetooth::shim::HciLayer>();
        modules.add<::bluetooth::shim::HciLayer>();
+1 −2
Original line number Original line Diff line number Diff line
@@ -2,7 +2,6 @@ filegroup {
    name: "BluetoothShimSources",
    name: "BluetoothShimSources",
    srcs: [
    srcs: [
            "advertising.cc",
            "advertising.cc",
            "controller.cc",
            "connectability.cc",
            "connectability.cc",
            "discoverability.cc",
            "discoverability.cc",
            "dumpsys.cc",
            "dumpsys.cc",
@@ -16,7 +15,7 @@ filegroup {
            "security.cc",
            "security.cc",
            "stack.cc",
            "stack.cc",
            "storage.cc",
            "storage.cc",
    ],
    ]
}
}


filegroup {
filegroup {
Loading