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

Commit 663d3b5e authored by Katherine Lai's avatar Katherine Lai
Browse files

gd: Move mgmt files from gd/hal to gd/os

Since mgmt provides a way to interact with linux kernel, move
related files to gd/os. Also spell out Mgmt fully to Management
and create singleton methods.

Bug: 372926952
Test: m -j
Flag: Exempt, no change to default behavior
Change-Id: Ia077af553bcbd15026a275140e4bc86bfbb03a11
parent da3c6d5e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -58,13 +58,13 @@ mgmt_cc_defaults {
    soong_config_variables: {
        vertical: {
            android_desktop: {
                srcs: [":BluetoothHalSources_mgmt"],
                srcs: [":BluetoothOsSources_mgmt_linux"],
            },
            android_default: {
                srcs: [":BluetoothHalSources_mgmt_stub"],
                srcs: [":BluetoothOsSources_mgmt"],
            },
            conditions_default: {
                srcs: [":BluetoothHalSources_mgmt_stub"],
                srcs: [":BluetoothOsSources_mgmt"],
            },
        },
    },
+0 −14
Original line number Diff line number Diff line
@@ -51,20 +51,6 @@ filegroup {
    ],
}

filegroup {
    name: "BluetoothHalSources_mgmt_stub",
    srcs: [
        "mgmt_stub.cc",
    ],
}

filegroup {
    name: "BluetoothHalSources_mgmt",
    srcs: [
        "mgmt.cc",
    ],
}

filegroup {
    name: "BluetoothHalSources_ranging_android",
    srcs: [
+0 −2
Original line number Diff line number Diff line
@@ -34,12 +34,10 @@ source_set("BluetoothHalSources_hci_host") {
  if (use.floss_rootcanal) {
    sources = [
      "hci_hal_host_rootcanal.cc",
      "mgmt.cc",
    ]
  } else {
    sources = [
      "hci_hal_host.cc",
      "mgmt.cc",
    ]
  }

+4 −2
Original line number Diff line number Diff line
@@ -24,8 +24,8 @@
#include "hal/hci_backend.h"
#include "hal/hci_hal.h"
#include "hal/link_clocker.h"
#include "hal/mgmt.h"
#include "hal/snoop_logger.h"
#include "os/mgmt.h"

namespace bluetooth::hal {

@@ -158,7 +158,9 @@ public:
    backend_->sendIsoData(packet);
  }

  uint16_t getMsftOpcode() override { return Mgmt().get_vs_opcode(MGMT_VS_OPCODE_MSFT); }
  uint16_t getMsftOpcode() override {
    return os::Management::getInstance().getVendorSpecificCode(MGMT_VS_OPCODE_MSFT);
  }

protected:
  void ListDependencies(ModuleList* list) const override {
+4 −2
Original line number Diff line number Diff line
@@ -34,9 +34,9 @@

#include "hal/hci_hal.h"
#include "hal/link_clocker.h"
#include "hal/mgmt.h"
#include "hal/snoop_logger.h"
#include "metrics/counter_metrics.h"
#include "os/mgmt.h"
#include "os/reactor.h"
#include "os/thread.h"

@@ -312,7 +312,9 @@ public:
    write_to_fd(packet);
  }

  uint16_t getMsftOpcode() override { return Mgmt().get_vs_opcode(MGMT_VS_OPCODE_MSFT); }
  uint16_t getMsftOpcode() override {
    return os::Management::getInstance().getVendorSpecificCode(MGMT_VS_OPCODE_MSFT);
  }

  void markControllerBroken() override {
    std::lock_guard<std::mutex> lock(api_mutex_);
Loading