Loading system/gd/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -141,6 +141,7 @@ cc_defaults { ":BluetoothDumpsysSources", ":BluetoothHalSources", ":BluetoothHciSources", ":BluetoothIsoSources", ":BluetoothL2capSources", ":BluetoothNeighborSources", ":BluetoothPacketSources", Loading Loading @@ -294,6 +295,7 @@ cc_test { ":BluetoothDumpsysTestSources", ":BluetoothHalTestSources", ":BluetoothHciTestSources", ":BluetoothIsoTestSources", ":BluetoothL2capTestSources", ":BluetoothNeighborTestSources", ":BluetoothPacketTestSources", Loading system/gd/hci/fuzz/fuzz_hci_layer.cc +8 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,10 @@ hci::LeScanningInterface* FuzzHciLayer::GetLeScanningInterface( return &le_scanning_interface_; } hci::LeIsoInterface* FuzzHciLayer::GetLeIsoInterface(ContextualCallback<void(hci::LeMetaEventView)> event_handler) { return &le_iso_interface_; } void FuzzHciLayer::Start() { acl_dev_null_ = new os::fuzz::DevNullQueue<AclPacketBuilder>(acl_queue_.GetDownEnd(), GetHandler()); acl_dev_null_->Start(); Loading Loading @@ -179,6 +183,10 @@ void FuzzHciLayer::injectLeScanningEvent(std::vector<uint8_t> data) { InvokeIfValid<LeMetaEventView>(le_scanning_event_handler_, data); } void FuzzHciLayer::injectLeIsoEvent(std::vector<uint8_t> data) { InvokeIfValid<LeMetaEventView>(le_iso_event_handler_, data); } const ModuleFactory FuzzHciLayer::Factory = ModuleFactory([]() { return new FuzzHciLayer(); }); } // namespace fuzz Loading system/gd/hci/fuzz/fuzz_hci_layer.h +5 −0 Original line number Diff line number Diff line Loading @@ -115,6 +115,8 @@ class FuzzHciLayer : public HciLayer { hci::LeScanningInterface* GetLeScanningInterface( common::ContextualCallback<void(hci::LeMetaEventView)> event_handler) override; hci::LeIsoInterface* GetLeIsoInterface(common::ContextualCallback<void(LeMetaEventView)> event_handler) override; void injectArbitrary(FuzzedDataProvider& fdp); std::string ToString() const override { Loading Loading @@ -148,6 +150,7 @@ class FuzzHciLayer : public HciLayer { void injectLeAdvertisingEvent(std::vector<uint8_t> data); void injectLeScanningEvent(std::vector<uint8_t> data); void injectLeIsoEvent(std::vector<uint8_t> data); FuzzedDataProvider* auto_reply_fdp; Loading @@ -161,6 +164,7 @@ class FuzzHciLayer : public HciLayer { FuzzCommandInterface<LeSecurityCommandBuilder> le_security_interface_{}; FuzzCommandInterface<LeAdvertisingCommandBuilder> le_advertising_interface_{}; FuzzCommandInterface<LeScanningCommandBuilder> le_scanning_interface_{}; FuzzCommandInterface<LeIsoCommandBuilder> le_iso_interface_{}; common::ContextualOnceCallback<void(hci::CommandCompleteView)> on_command_complete_; common::ContextualOnceCallback<void(hci::CommandStatusView)> on_command_status_; Loading @@ -176,6 +180,7 @@ class FuzzHciLayer : public HciLayer { common::ContextualCallback<void(uint16_t, hci::ErrorCode)> le_acl_on_disconnect_; common::ContextualCallback<void(hci::LeMetaEventView)> le_advertising_event_handler_; common::ContextualCallback<void(hci::LeMetaEventView)> le_scanning_event_handler_; common::ContextualCallback<void(hci::LeMetaEventView)> le_iso_event_handler_; }; } // namespace fuzz Loading system/gd/hci/hci_layer.cc +7 −0 Original line number Diff line number Diff line Loading @@ -405,6 +405,13 @@ LeScanningInterface* HciLayer::GetLeScanningInterface(ContextualCallback<void(Le return &le_scanning_interface; } LeIsoInterface* HciLayer::GetLeIsoInterface(ContextualCallback<void(LeMetaEventView)> event_handler) { for (const auto subevent : LeIsoEvents) { RegisterLeEventHandler(subevent, event_handler); } return &le_iso_interface; } const ModuleFactory HciLayer::Factory = ModuleFactory([]() { return new HciLayer(); }); void HciLayer::ListDependencies(ModuleList* list) { Loading system/gd/hci/hci_layer.h +4 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ #include "hci/hci_packets.h" #include "hci/le_acl_connection_interface.h" #include "hci/le_advertising_interface.h" #include "hci/le_iso_interface.h" #include "hci/le_scanning_interface.h" #include "hci/le_security_interface.h" #include "hci/security_interface.h" Loading Loading @@ -82,6 +83,8 @@ class HciLayer : public Module, public CommandInterface<CommandPacketBuilder> { virtual LeScanningInterface* GetLeScanningInterface(common::ContextualCallback<void(LeMetaEventView)> event_handler); virtual LeIsoInterface* GetLeIsoInterface(common::ContextualCallback<void(LeMetaEventView)> event_handler); std::string ToString() const override { return "Hci Layer"; } Loading Loading @@ -138,6 +141,7 @@ class HciLayer : public Module, public CommandInterface<CommandPacketBuilder> { CommandInterfaceImpl<LeSecurityCommandBuilder> le_security_interface{*this}; CommandInterfaceImpl<LeAdvertisingCommandBuilder> le_advertising_interface{*this}; CommandInterfaceImpl<LeScanningCommandBuilder> le_scanning_interface{*this}; CommandInterfaceImpl<LeIsoCommandBuilder> le_iso_interface{*this}; }; } // namespace hci } // namespace bluetooth Loading
system/gd/Android.bp +2 −0 Original line number Diff line number Diff line Loading @@ -141,6 +141,7 @@ cc_defaults { ":BluetoothDumpsysSources", ":BluetoothHalSources", ":BluetoothHciSources", ":BluetoothIsoSources", ":BluetoothL2capSources", ":BluetoothNeighborSources", ":BluetoothPacketSources", Loading Loading @@ -294,6 +295,7 @@ cc_test { ":BluetoothDumpsysTestSources", ":BluetoothHalTestSources", ":BluetoothHciTestSources", ":BluetoothIsoTestSources", ":BluetoothL2capTestSources", ":BluetoothNeighborTestSources", ":BluetoothPacketTestSources", Loading
system/gd/hci/fuzz/fuzz_hci_layer.cc +8 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,10 @@ hci::LeScanningInterface* FuzzHciLayer::GetLeScanningInterface( return &le_scanning_interface_; } hci::LeIsoInterface* FuzzHciLayer::GetLeIsoInterface(ContextualCallback<void(hci::LeMetaEventView)> event_handler) { return &le_iso_interface_; } void FuzzHciLayer::Start() { acl_dev_null_ = new os::fuzz::DevNullQueue<AclPacketBuilder>(acl_queue_.GetDownEnd(), GetHandler()); acl_dev_null_->Start(); Loading Loading @@ -179,6 +183,10 @@ void FuzzHciLayer::injectLeScanningEvent(std::vector<uint8_t> data) { InvokeIfValid<LeMetaEventView>(le_scanning_event_handler_, data); } void FuzzHciLayer::injectLeIsoEvent(std::vector<uint8_t> data) { InvokeIfValid<LeMetaEventView>(le_iso_event_handler_, data); } const ModuleFactory FuzzHciLayer::Factory = ModuleFactory([]() { return new FuzzHciLayer(); }); } // namespace fuzz Loading
system/gd/hci/fuzz/fuzz_hci_layer.h +5 −0 Original line number Diff line number Diff line Loading @@ -115,6 +115,8 @@ class FuzzHciLayer : public HciLayer { hci::LeScanningInterface* GetLeScanningInterface( common::ContextualCallback<void(hci::LeMetaEventView)> event_handler) override; hci::LeIsoInterface* GetLeIsoInterface(common::ContextualCallback<void(LeMetaEventView)> event_handler) override; void injectArbitrary(FuzzedDataProvider& fdp); std::string ToString() const override { Loading Loading @@ -148,6 +150,7 @@ class FuzzHciLayer : public HciLayer { void injectLeAdvertisingEvent(std::vector<uint8_t> data); void injectLeScanningEvent(std::vector<uint8_t> data); void injectLeIsoEvent(std::vector<uint8_t> data); FuzzedDataProvider* auto_reply_fdp; Loading @@ -161,6 +164,7 @@ class FuzzHciLayer : public HciLayer { FuzzCommandInterface<LeSecurityCommandBuilder> le_security_interface_{}; FuzzCommandInterface<LeAdvertisingCommandBuilder> le_advertising_interface_{}; FuzzCommandInterface<LeScanningCommandBuilder> le_scanning_interface_{}; FuzzCommandInterface<LeIsoCommandBuilder> le_iso_interface_{}; common::ContextualOnceCallback<void(hci::CommandCompleteView)> on_command_complete_; common::ContextualOnceCallback<void(hci::CommandStatusView)> on_command_status_; Loading @@ -176,6 +180,7 @@ class FuzzHciLayer : public HciLayer { common::ContextualCallback<void(uint16_t, hci::ErrorCode)> le_acl_on_disconnect_; common::ContextualCallback<void(hci::LeMetaEventView)> le_advertising_event_handler_; common::ContextualCallback<void(hci::LeMetaEventView)> le_scanning_event_handler_; common::ContextualCallback<void(hci::LeMetaEventView)> le_iso_event_handler_; }; } // namespace fuzz Loading
system/gd/hci/hci_layer.cc +7 −0 Original line number Diff line number Diff line Loading @@ -405,6 +405,13 @@ LeScanningInterface* HciLayer::GetLeScanningInterface(ContextualCallback<void(Le return &le_scanning_interface; } LeIsoInterface* HciLayer::GetLeIsoInterface(ContextualCallback<void(LeMetaEventView)> event_handler) { for (const auto subevent : LeIsoEvents) { RegisterLeEventHandler(subevent, event_handler); } return &le_iso_interface; } const ModuleFactory HciLayer::Factory = ModuleFactory([]() { return new HciLayer(); }); void HciLayer::ListDependencies(ModuleList* list) { Loading
system/gd/hci/hci_layer.h +4 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ #include "hci/hci_packets.h" #include "hci/le_acl_connection_interface.h" #include "hci/le_advertising_interface.h" #include "hci/le_iso_interface.h" #include "hci/le_scanning_interface.h" #include "hci/le_security_interface.h" #include "hci/security_interface.h" Loading Loading @@ -82,6 +83,8 @@ class HciLayer : public Module, public CommandInterface<CommandPacketBuilder> { virtual LeScanningInterface* GetLeScanningInterface(common::ContextualCallback<void(LeMetaEventView)> event_handler); virtual LeIsoInterface* GetLeIsoInterface(common::ContextualCallback<void(LeMetaEventView)> event_handler); std::string ToString() const override { return "Hci Layer"; } Loading Loading @@ -138,6 +141,7 @@ class HciLayer : public Module, public CommandInterface<CommandPacketBuilder> { CommandInterfaceImpl<LeSecurityCommandBuilder> le_security_interface{*this}; CommandInterfaceImpl<LeAdvertisingCommandBuilder> le_advertising_interface{*this}; CommandInterfaceImpl<LeScanningCommandBuilder> le_scanning_interface{*this}; CommandInterfaceImpl<LeIsoCommandBuilder> le_iso_interface{*this}; }; } // namespace hci } // namespace bluetooth