Loading system/gd/Android.bp +26 −3 Original line number Diff line number Diff line Loading @@ -149,11 +149,14 @@ cc_defaults { ":BluetoothStorageSources", ], generated_headers: [ "BluetoothGeneratedBundler_h", "BluetoothGeneratedPackets_h", "BluetoothGeneratedDumpsysData_h", ], shared_libs: [ "libchrome", "libcrypto", "libflatbuffers-cpp", ], static_libs: [ "libbluetooth-protos", Loading Loading @@ -200,6 +203,7 @@ cc_binary { ], generated_headers: [ "BluetoothFacadeGeneratedStub_h", "BluetoothGeneratedDumpsysData_h", "BluetoothGeneratedPackets_h", // Needed here to guarantee that generated zip file is created before // bluetooth_cert_tests.zip is packaged Loading @@ -209,9 +213,10 @@ cc_binary { "BluetoothFacadeGeneratedStub_cc", ], static_libs: [ "libbluetooth_gd", "libbluetooth-protos", "breakpad_client", "libbluetooth-protos", "libbluetooth_gd", "libflatbuffers-cpp", ], shared_libs: [ "libbacktrace", Loading Loading @@ -286,13 +291,15 @@ cc_test { ":BluetoothStorageTestSources", ], generated_headers: [ "BluetoothGeneratedDumpsysData_h", "BluetoothGeneratedPackets_h", ], static_libs: [ "libbluetooth-protos", "libbluetooth_gd", "libgmock", "libc++fs", "libflatbuffers-cpp", "libgmock", ], shared_libs: [ "libchrome", Loading Loading @@ -340,10 +347,12 @@ cc_defaults { ], host_supported: true, generated_headers: [ "BluetoothGeneratedDumpsysData_h", "BluetoothGeneratedPackets_h", ], shared_libs: [ "libcrypto", "libflatbuffers-cpp", ], cflags: [ "-DFUZZ_TARGET", Loading Loading @@ -428,6 +437,20 @@ genrule { ], } genrule { name: "BluetoothGeneratedDumpsysData_h", tools: [ "flatc", ], cmd: "$(location flatc) -I packages/modules/Bluetooth/system/gd -o $(genDir) --cpp $(in) ", srcs: [ "dumpsys_data.fbs", ], out: [ "dumpsys_data_generated.h", ], } genrule { name: "BluetoothGeneratedPackets_python3_cc", tools: [ Loading system/gd/dumpsys/bundler/Android.bp +0 −1 Original line number Diff line number Diff line Loading @@ -74,4 +74,3 @@ cc_test { "test.bfbs", ], } system/gd/dumpsys_data.fbs 0 → 100644 +11 −0 Original line number Diff line number Diff line // Top level module dumpsys data schema namespace bluetooth; attribute "privacy"; table DumpsysData { title:string; } root_type DumpsysData; system/gd/module.cc +10 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,11 @@ Handler* Module::GetHandler() const { return handler_; } DumpsysDataFinisher EmptyDumpsysDataFinisher = [](DumpsysDataBuilder* dumpsys_data_builder) {}; DumpsysDataFinisher Module::GetTable(flatbuffers::FlatBufferBuilder* builder) const { return EmptyDumpsysDataFinisher; } const ModuleRegistry* Module::GetModuleRegistry() const { return registry_; } Loading Loading @@ -121,4 +126,9 @@ os::Handler* ModuleRegistry::GetModuleHandler(const ModuleFactory* module) const return nullptr; } void ModuleDumper::DumpState(std::string* output) const { // TODO(cmanton) *output = std::string("TBD"); } } // namespace bluetooth system/gd/module.h +10 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ #pragma once #include <flatbuffers/flatbuffers.h> #include <functional> #include <future> #include <map> Loading @@ -23,6 +24,7 @@ #include <vector> #include "common/bind.h" #include "dumpsys_data_generated.h" #include "os/handler.h" #include "os/log.h" #include "os/thread.h" Loading Loading @@ -60,6 +62,8 @@ public: std::vector<const ModuleFactory*> list_; }; using DumpsysDataFinisher = std::function<void(DumpsysDataBuilder* dumpsys_data_builder)>; // Each leaf node module must have a factory like so: // // static const ModuleFactory Factory; Loading @@ -85,6 +89,9 @@ class Module { // Release all resources, you're about to be deleted virtual void Stop() = 0; // Get relevant state data from the module virtual DumpsysDataFinisher GetTable(flatbuffers::FlatBufferBuilder* builder) const; virtual std::string ToString() const; ::bluetooth::os::Handler* GetHandler() const; Loading Loading @@ -153,10 +160,11 @@ class ModuleRegistry { class ModuleDumper { public: ModuleDumper(ModuleRegistry& module_registry) : module_registry_(module_registry) {} ModuleDumper(const ModuleRegistry& module_registry) : module_registry_(module_registry) {} void DumpState(std::string* output) const; private: [[maybe_unused]] ModuleRegistry& module_registry_; [[maybe_unused]] const ModuleRegistry& module_registry_; }; class TestModuleRegistry : public ModuleRegistry { Loading Loading
system/gd/Android.bp +26 −3 Original line number Diff line number Diff line Loading @@ -149,11 +149,14 @@ cc_defaults { ":BluetoothStorageSources", ], generated_headers: [ "BluetoothGeneratedBundler_h", "BluetoothGeneratedPackets_h", "BluetoothGeneratedDumpsysData_h", ], shared_libs: [ "libchrome", "libcrypto", "libflatbuffers-cpp", ], static_libs: [ "libbluetooth-protos", Loading Loading @@ -200,6 +203,7 @@ cc_binary { ], generated_headers: [ "BluetoothFacadeGeneratedStub_h", "BluetoothGeneratedDumpsysData_h", "BluetoothGeneratedPackets_h", // Needed here to guarantee that generated zip file is created before // bluetooth_cert_tests.zip is packaged Loading @@ -209,9 +213,10 @@ cc_binary { "BluetoothFacadeGeneratedStub_cc", ], static_libs: [ "libbluetooth_gd", "libbluetooth-protos", "breakpad_client", "libbluetooth-protos", "libbluetooth_gd", "libflatbuffers-cpp", ], shared_libs: [ "libbacktrace", Loading Loading @@ -286,13 +291,15 @@ cc_test { ":BluetoothStorageTestSources", ], generated_headers: [ "BluetoothGeneratedDumpsysData_h", "BluetoothGeneratedPackets_h", ], static_libs: [ "libbluetooth-protos", "libbluetooth_gd", "libgmock", "libc++fs", "libflatbuffers-cpp", "libgmock", ], shared_libs: [ "libchrome", Loading Loading @@ -340,10 +347,12 @@ cc_defaults { ], host_supported: true, generated_headers: [ "BluetoothGeneratedDumpsysData_h", "BluetoothGeneratedPackets_h", ], shared_libs: [ "libcrypto", "libflatbuffers-cpp", ], cflags: [ "-DFUZZ_TARGET", Loading Loading @@ -428,6 +437,20 @@ genrule { ], } genrule { name: "BluetoothGeneratedDumpsysData_h", tools: [ "flatc", ], cmd: "$(location flatc) -I packages/modules/Bluetooth/system/gd -o $(genDir) --cpp $(in) ", srcs: [ "dumpsys_data.fbs", ], out: [ "dumpsys_data_generated.h", ], } genrule { name: "BluetoothGeneratedPackets_python3_cc", tools: [ Loading
system/gd/dumpsys/bundler/Android.bp +0 −1 Original line number Diff line number Diff line Loading @@ -74,4 +74,3 @@ cc_test { "test.bfbs", ], }
system/gd/dumpsys_data.fbs 0 → 100644 +11 −0 Original line number Diff line number Diff line // Top level module dumpsys data schema namespace bluetooth; attribute "privacy"; table DumpsysData { title:string; } root_type DumpsysData;
system/gd/module.cc +10 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,11 @@ Handler* Module::GetHandler() const { return handler_; } DumpsysDataFinisher EmptyDumpsysDataFinisher = [](DumpsysDataBuilder* dumpsys_data_builder) {}; DumpsysDataFinisher Module::GetTable(flatbuffers::FlatBufferBuilder* builder) const { return EmptyDumpsysDataFinisher; } const ModuleRegistry* Module::GetModuleRegistry() const { return registry_; } Loading Loading @@ -121,4 +126,9 @@ os::Handler* ModuleRegistry::GetModuleHandler(const ModuleFactory* module) const return nullptr; } void ModuleDumper::DumpState(std::string* output) const { // TODO(cmanton) *output = std::string("TBD"); } } // namespace bluetooth
system/gd/module.h +10 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ #pragma once #include <flatbuffers/flatbuffers.h> #include <functional> #include <future> #include <map> Loading @@ -23,6 +24,7 @@ #include <vector> #include "common/bind.h" #include "dumpsys_data_generated.h" #include "os/handler.h" #include "os/log.h" #include "os/thread.h" Loading Loading @@ -60,6 +62,8 @@ public: std::vector<const ModuleFactory*> list_; }; using DumpsysDataFinisher = std::function<void(DumpsysDataBuilder* dumpsys_data_builder)>; // Each leaf node module must have a factory like so: // // static const ModuleFactory Factory; Loading @@ -85,6 +89,9 @@ class Module { // Release all resources, you're about to be deleted virtual void Stop() = 0; // Get relevant state data from the module virtual DumpsysDataFinisher GetTable(flatbuffers::FlatBufferBuilder* builder) const; virtual std::string ToString() const; ::bluetooth::os::Handler* GetHandler() const; Loading Loading @@ -153,10 +160,11 @@ class ModuleRegistry { class ModuleDumper { public: ModuleDumper(ModuleRegistry& module_registry) : module_registry_(module_registry) {} ModuleDumper(const ModuleRegistry& module_registry) : module_registry_(module_registry) {} void DumpState(std::string* output) const; private: [[maybe_unused]] ModuleRegistry& module_registry_; [[maybe_unused]] const ModuleRegistry& module_registry_; }; class TestModuleRegistry : public ModuleRegistry { Loading