Loading system/gd/hci/vendor_specific_event_manager.h +7 −3 Original line number Diff line number Diff line Loading @@ -16,20 +16,24 @@ #pragma once #include "hci/hci_packets.h" #include "hci/vendor_specific_event_manager_interface.h" #include "module.h" namespace bluetooth { namespace hci { class VendorSpecificEventManager : public bluetooth::Module { class VendorSpecificEventManager : public VendorSpecificEventManagerInterface, public bluetooth::Module { public: VendorSpecificEventManager(); VendorSpecificEventManager(const VendorSpecificEventManager&) = delete; VendorSpecificEventManager& operator=(const VendorSpecificEventManager&) = delete; void RegisterEventHandler(VseSubeventCode event, common::ContextualCallback<void(VendorSpecificEventView)> handler); void RegisterEventHandler( VseSubeventCode event, common::ContextualCallback<void(VendorSpecificEventView)> handler) override; void UnregisterEventHandler(VseSubeventCode event); void UnregisterEventHandler(VseSubeventCode event) override; static const ModuleFactory Factory; Loading system/gd/hci/vendor_specific_event_manager_interface.h 0 → 100644 +39 −0 Original line number Diff line number Diff line /* * Copyright 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include "common/contextual_callback.h" #include "hci/hci_packets.h" namespace bluetooth { namespace hci { class VendorSpecificEventManagerInterface { public: VendorSpecificEventManagerInterface() = default; virtual ~VendorSpecificEventManagerInterface() = default; VendorSpecificEventManagerInterface(const VendorSpecificEventManagerInterface&) = delete; VendorSpecificEventManagerInterface& operator=(const VendorSpecificEventManagerInterface&) = delete; virtual void RegisterEventHandler( VseSubeventCode event, common::ContextualCallback<void(VendorSpecificEventView)> handler) = 0; virtual void UnregisterEventHandler(VseSubeventCode event) = 0; }; } // namespace hci } // namespace bluetooth system/gd/hci/vendor_specific_event_manager_mock.h 0 → 100644 +36 −0 Original line number Diff line number Diff line /* * Copyright 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include <gmock/gmock.h> #include "common/contextual_callback.h" #include "hci/hci_packets.h" #include "hci/vendor_specific_event_manager_interface.h" namespace bluetooth::hci::testing { class MockVendorSpecificEventManager : public VendorSpecificEventManagerInterface { public: MOCK_METHOD( (void), RegisterEventHandler, (VseSubeventCode, common::ContextualCallback<void(VendorSpecificEventView)>), (override)); MOCK_METHOD((void), UnregisterEventHandler, (VseSubeventCode), (override)); }; } // namespace bluetooth::hci::testing system/main/shim/entry.cc +1 −1 Original line number Diff line number Diff line Loading @@ -96,7 +96,7 @@ hci::AclManager* GetAclManager() { ->GetInstance<hci::AclManager>(); } hci::VendorSpecificEventManager* GetVendorSpecificEventManager() { hci::VendorSpecificEventManagerInterface* GetVendorSpecificEventManager() { return Stack::GetInstance() ->GetStackManager() ->GetInstance<hci::VendorSpecificEventManager>(); Loading system/main/shim/entry.h +2 −2 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ class RemoteNameRequestModule; class DistanceMeasurementManager; class LeAdvertisingManager; class LeScanningManager; class VendorSpecificEventManager; class VendorSpecificEventManagerInterface; #if TARGET_FLOSS class MsftExtensionManager; #endif Loading Loading @@ -75,7 +75,7 @@ hci::LeScanningManager* GetScanning(); hal::SnoopLogger* GetSnoopLogger(); storage::StorageModule* GetStorage(); hci::AclManager* GetAclManager(); hci::VendorSpecificEventManager* GetVendorSpecificEventManager(); hci::VendorSpecificEventManagerInterface* GetVendorSpecificEventManager(); metrics::CounterMetrics* GetCounterMetrics(); #if TARGET_FLOSS hci::MsftExtensionManager* GetMsftExtensionManager(); Loading Loading
system/gd/hci/vendor_specific_event_manager.h +7 −3 Original line number Diff line number Diff line Loading @@ -16,20 +16,24 @@ #pragma once #include "hci/hci_packets.h" #include "hci/vendor_specific_event_manager_interface.h" #include "module.h" namespace bluetooth { namespace hci { class VendorSpecificEventManager : public bluetooth::Module { class VendorSpecificEventManager : public VendorSpecificEventManagerInterface, public bluetooth::Module { public: VendorSpecificEventManager(); VendorSpecificEventManager(const VendorSpecificEventManager&) = delete; VendorSpecificEventManager& operator=(const VendorSpecificEventManager&) = delete; void RegisterEventHandler(VseSubeventCode event, common::ContextualCallback<void(VendorSpecificEventView)> handler); void RegisterEventHandler( VseSubeventCode event, common::ContextualCallback<void(VendorSpecificEventView)> handler) override; void UnregisterEventHandler(VseSubeventCode event); void UnregisterEventHandler(VseSubeventCode event) override; static const ModuleFactory Factory; Loading
system/gd/hci/vendor_specific_event_manager_interface.h 0 → 100644 +39 −0 Original line number Diff line number Diff line /* * Copyright 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include "common/contextual_callback.h" #include "hci/hci_packets.h" namespace bluetooth { namespace hci { class VendorSpecificEventManagerInterface { public: VendorSpecificEventManagerInterface() = default; virtual ~VendorSpecificEventManagerInterface() = default; VendorSpecificEventManagerInterface(const VendorSpecificEventManagerInterface&) = delete; VendorSpecificEventManagerInterface& operator=(const VendorSpecificEventManagerInterface&) = delete; virtual void RegisterEventHandler( VseSubeventCode event, common::ContextualCallback<void(VendorSpecificEventView)> handler) = 0; virtual void UnregisterEventHandler(VseSubeventCode event) = 0; }; } // namespace hci } // namespace bluetooth
system/gd/hci/vendor_specific_event_manager_mock.h 0 → 100644 +36 −0 Original line number Diff line number Diff line /* * Copyright 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include <gmock/gmock.h> #include "common/contextual_callback.h" #include "hci/hci_packets.h" #include "hci/vendor_specific_event_manager_interface.h" namespace bluetooth::hci::testing { class MockVendorSpecificEventManager : public VendorSpecificEventManagerInterface { public: MOCK_METHOD( (void), RegisterEventHandler, (VseSubeventCode, common::ContextualCallback<void(VendorSpecificEventView)>), (override)); MOCK_METHOD((void), UnregisterEventHandler, (VseSubeventCode), (override)); }; } // namespace bluetooth::hci::testing
system/main/shim/entry.cc +1 −1 Original line number Diff line number Diff line Loading @@ -96,7 +96,7 @@ hci::AclManager* GetAclManager() { ->GetInstance<hci::AclManager>(); } hci::VendorSpecificEventManager* GetVendorSpecificEventManager() { hci::VendorSpecificEventManagerInterface* GetVendorSpecificEventManager() { return Stack::GetInstance() ->GetStackManager() ->GetInstance<hci::VendorSpecificEventManager>(); Loading
system/main/shim/entry.h +2 −2 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ class RemoteNameRequestModule; class DistanceMeasurementManager; class LeAdvertisingManager; class LeScanningManager; class VendorSpecificEventManager; class VendorSpecificEventManagerInterface; #if TARGET_FLOSS class MsftExtensionManager; #endif Loading Loading @@ -75,7 +75,7 @@ hci::LeScanningManager* GetScanning(); hal::SnoopLogger* GetSnoopLogger(); storage::StorageModule* GetStorage(); hci::AclManager* GetAclManager(); hci::VendorSpecificEventManager* GetVendorSpecificEventManager(); hci::VendorSpecificEventManagerInterface* GetVendorSpecificEventManager(); metrics::CounterMetrics* GetCounterMetrics(); #if TARGET_FLOSS hci::MsftExtensionManager* GetMsftExtensionManager(); Loading