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

Commit 73a347a7 authored by Chris Manton's avatar Chris Manton
Browse files

Fill out the dump module proto

Add bluetooth proto library to build

Bug: 153703013
Test: Manual verification

Change-Id: I0c7a6edd6b7dc2a780d4ae42c8e2d56eb08e5da5
parent 392a4936
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -114,11 +114,17 @@ cc_defaults {
            srcs: [
                ":BluetoothOsSources_linux_generic",
            ],
            shared_libs: [
                "libprotobuf-cpp-full",
            ],
        },
        host: {
            srcs: [
                ":BluetoothHalSources_hci_rootcanal",
            ],
            shared_libs: [
                "libprotobuf-cpp-full",
            ],
        },
        android: {
            srcs: [
@@ -153,6 +159,9 @@ cc_defaults {
        "libchrome",
        "libcrypto",
    ],
    static_libs: [
        "libbluetooth-protos",
    ]
}

cc_library {
@@ -205,6 +214,7 @@ cc_binary {
    ],
    static_libs: [
        "libbluetooth_gd",
        "libbluetooth-protos",
    ],
    shared_libs: [
        "libchrome",
@@ -279,12 +289,14 @@ cc_test {
        "BluetoothGeneratedPackets_h",
    ],
    static_libs: [
        "libbluetooth-protos",
        "libbluetooth_gd",
        "libgmock",
    ],
    shared_libs: [
        "libchrome",
        "libcrypto",
        "libprotobuf-cpp-full",
    ],
    sanitize: {
        address: true,
@@ -320,6 +332,7 @@ cc_defaults {
        ":BluetoothHciFuzzHelperSources",
    ],
    static_libs: [
        "libbluetooth-protos",
        "libbluetooth_gd_fuzzing",
        "libchrome",
        "libgmock",
@@ -331,6 +344,7 @@ cc_defaults {
    ],
    shared_libs: [
        "libcrypto",
        "libprotobuf-cpp-full",
    ],
    cflags: [
        "-DFUZZ_TARGET",
+7 −1
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
 */

#include "module.h"
#include "bluetooth/dumpmod.pb.h"

using ::bluetooth::os::Handler;
using ::bluetooth::os::Thread;
@@ -126,6 +127,8 @@ os::Handler* ModuleRegistry::GetModuleHandler(const ModuleFactory* module) const
}

void ModuleDumper::DumpState() const {
  Dumpmod dumpmod;

  for (auto it = module_registry_.start_order_.rbegin(); it != module_registry_.start_order_.rend(); it++) {
    auto instance = module_registry_.started_modules_.find(*it);
    ASSERT(instance != module_registry_.started_modules_.end());
@@ -133,7 +136,10 @@ void ModuleDumper::DumpState() const {
    if (message == nullptr) {
      continue;
    }
    // TODO(cmanton) Process module message into master proto
    ModuleDumpState dump_state;
    dump_state.set_name(instance->second->ToString());
    dump_state.mutable_data()->PackFrom(*message);
    dumpmod.mutable_module_dump_states()->insert({dump_state.name(), dump_state});
  }
}

+5 −0
Original line number Diff line number Diff line
@@ -22,10 +22,15 @@ cc_library_static {
    host_supported: true,
    proto: {
        export_proto_headers: true,
        type: "lite",
        include_dirs: ["external/protobuf/src"],
    },
    srcs: [
        "bluetooth/dumpmod.proto",
        "bluetooth/metrics/bluetooth.proto"
    ],
    apex_available: [
        "//apex_available:platform",
        "com.android.bluetooth.updatable",
    ],
}