Loading system/btif/src/btif_bqr.cc +2 −3 Original line number Diff line number Diff line Loading @@ -34,7 +34,6 @@ #include "core_callbacks.h" #include "hci/hci_interface.h" #include "hci/hci_packets.h" #include "hci/vendor_specific_event_manager_interface.h" #include "internal_include/bt_trace.h" #include "main/shim/entry.h" #include "osi/include/properties.h" Loading Loading @@ -982,13 +981,13 @@ static void vendor_specific_event_callback( } void register_vse() { bluetooth::shim::GetVendorSpecificEventManager()->RegisterEventHandler( bluetooth::shim::GetHciLayer()->RegisterVendorSpecificEventHandler( hci::VseSubeventCode::BQR_EVENT, to_bind_->Bind(vendor_specific_event_callback)); } void unregister_vse() { bluetooth::shim::GetVendorSpecificEventManager()->UnregisterEventHandler( bluetooth::shim::GetHciLayer()->UnregisterVendorSpecificEventHandler( hci::VseSubeventCode::BQR_EVENT); } Loading system/btif/test/btif_core_test.cc +6 −9 Original line number Diff line number Diff line Loading @@ -42,7 +42,6 @@ #include "gtest/gtest.h" #include "hci/controller_interface_mock.h" #include "hci/hci_layer_mock.h" #include "hci/vendor_specific_event_manager_mock.h" #include "include/hardware/bluetooth.h" #include "include/hardware/bt_av.h" #include "main/shim/entry.h" Loading Loading @@ -877,8 +876,6 @@ class BtifCoreWithVendorSupportTest : public BtifCoreWithControllerTest { void SetUp() override { BtifCoreWithControllerTest::SetUp(); bluetooth::hci::testing::mock_hci_layer_ = &hci_; bluetooth::hci::testing::mock_vendor_specific_event_manager_ = &vendor_manager_; test::mock::osi_properties::osi_property_get.body = get_properties; std::promise<void> configuration_promise; Loading Loading @@ -924,8 +921,9 @@ class BtifCoreWithVendorSupportTest : public BtifCoreWithControllerTest { callback(response); }) .RetiresOnSaturation(); EXPECT_CALL(vendor_manager_, RegisterEventHandler(VseSubeventCode::BQR_EVENT, _)) EXPECT_CALL( hci_, RegisterVendorSpecificEventHandler(VseSubeventCode::BQR_EVENT, _)) .WillOnce(SaveArg<1>(&this->vse_callback_)); do_in_main_thread(FROM_HERE, BindOnce([]() { bluetooth::bqr::EnableBtQualityReport(get_main()); Loading @@ -938,8 +936,9 @@ class BtifCoreWithVendorSupportTest : public BtifCoreWithControllerTest { std::promise<void> disable_promise; auto disable_future = disable_promise.get_future(); auto set_promise = [&disable_promise]() { disable_promise.set_value(); }; EXPECT_CALL(vendor_manager_, UnregisterEventHandler(VseSubeventCode::BQR_EVENT)); EXPECT_CALL( hci_, UnregisterVendorSpecificEventHandler(VseSubeventCode::BQR_EVENT)); EXPECT_CALL( hci_, EnqueueCommand( Loading @@ -953,11 +952,9 @@ class BtifCoreWithVendorSupportTest : public BtifCoreWithControllerTest { disable_future.wait_for(std::chrono::seconds(1))); bluetooth::hci::testing::mock_hci_layer_ = nullptr; bluetooth::hci::testing::mock_vendor_specific_event_manager_ = nullptr; BtifCoreWithControllerTest::TearDown(); } bluetooth::hci::testing::MockHciLayer hci_; bluetooth::hci::testing::MockVendorSpecificEventManager vendor_manager_; ContextualCallback<void(VendorSpecificEventView)> vse_callback_; PostableContext* context; }; Loading system/gd/hci/Android.bp +0 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ filegroup { "link_key.cc", "remote_name_request.cc", "uuid.cc", "vendor_specific_event_manager.cc", ], } Loading system/gd/hci/BUILD.gn +0 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,6 @@ source_set("BluetoothHciSources") { "msft.cc", "remote_name_request.cc", "uuid.cc", "vendor_specific_event_manager.cc", ] include_dirs = [ "//bt/system/gd" ] Loading system/gd/hci/hci_interface.h +6 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,12 @@ class HciInterface : public CommandInterface<CommandBuilder> { virtual void UnregisterLeEventHandler(SubeventCode subevent_code) = 0; virtual void RegisterVendorSpecificEventHandler( VseSubeventCode subevent_code, common::ContextualCallback<void(VendorSpecificEventView)> event_handler) = 0; virtual void UnregisterVendorSpecificEventHandler(VseSubeventCode subevent_code) = 0; virtual void RegisterForDisconnects( common::ContextualCallback<void(uint16_t, hci::ErrorCode)> on_disconnect) = 0; Loading Loading
system/btif/src/btif_bqr.cc +2 −3 Original line number Diff line number Diff line Loading @@ -34,7 +34,6 @@ #include "core_callbacks.h" #include "hci/hci_interface.h" #include "hci/hci_packets.h" #include "hci/vendor_specific_event_manager_interface.h" #include "internal_include/bt_trace.h" #include "main/shim/entry.h" #include "osi/include/properties.h" Loading Loading @@ -982,13 +981,13 @@ static void vendor_specific_event_callback( } void register_vse() { bluetooth::shim::GetVendorSpecificEventManager()->RegisterEventHandler( bluetooth::shim::GetHciLayer()->RegisterVendorSpecificEventHandler( hci::VseSubeventCode::BQR_EVENT, to_bind_->Bind(vendor_specific_event_callback)); } void unregister_vse() { bluetooth::shim::GetVendorSpecificEventManager()->UnregisterEventHandler( bluetooth::shim::GetHciLayer()->UnregisterVendorSpecificEventHandler( hci::VseSubeventCode::BQR_EVENT); } Loading
system/btif/test/btif_core_test.cc +6 −9 Original line number Diff line number Diff line Loading @@ -42,7 +42,6 @@ #include "gtest/gtest.h" #include "hci/controller_interface_mock.h" #include "hci/hci_layer_mock.h" #include "hci/vendor_specific_event_manager_mock.h" #include "include/hardware/bluetooth.h" #include "include/hardware/bt_av.h" #include "main/shim/entry.h" Loading Loading @@ -877,8 +876,6 @@ class BtifCoreWithVendorSupportTest : public BtifCoreWithControllerTest { void SetUp() override { BtifCoreWithControllerTest::SetUp(); bluetooth::hci::testing::mock_hci_layer_ = &hci_; bluetooth::hci::testing::mock_vendor_specific_event_manager_ = &vendor_manager_; test::mock::osi_properties::osi_property_get.body = get_properties; std::promise<void> configuration_promise; Loading Loading @@ -924,8 +921,9 @@ class BtifCoreWithVendorSupportTest : public BtifCoreWithControllerTest { callback(response); }) .RetiresOnSaturation(); EXPECT_CALL(vendor_manager_, RegisterEventHandler(VseSubeventCode::BQR_EVENT, _)) EXPECT_CALL( hci_, RegisterVendorSpecificEventHandler(VseSubeventCode::BQR_EVENT, _)) .WillOnce(SaveArg<1>(&this->vse_callback_)); do_in_main_thread(FROM_HERE, BindOnce([]() { bluetooth::bqr::EnableBtQualityReport(get_main()); Loading @@ -938,8 +936,9 @@ class BtifCoreWithVendorSupportTest : public BtifCoreWithControllerTest { std::promise<void> disable_promise; auto disable_future = disable_promise.get_future(); auto set_promise = [&disable_promise]() { disable_promise.set_value(); }; EXPECT_CALL(vendor_manager_, UnregisterEventHandler(VseSubeventCode::BQR_EVENT)); EXPECT_CALL( hci_, UnregisterVendorSpecificEventHandler(VseSubeventCode::BQR_EVENT)); EXPECT_CALL( hci_, EnqueueCommand( Loading @@ -953,11 +952,9 @@ class BtifCoreWithVendorSupportTest : public BtifCoreWithControllerTest { disable_future.wait_for(std::chrono::seconds(1))); bluetooth::hci::testing::mock_hci_layer_ = nullptr; bluetooth::hci::testing::mock_vendor_specific_event_manager_ = nullptr; BtifCoreWithControllerTest::TearDown(); } bluetooth::hci::testing::MockHciLayer hci_; bluetooth::hci::testing::MockVendorSpecificEventManager vendor_manager_; ContextualCallback<void(VendorSpecificEventView)> vse_callback_; PostableContext* context; }; Loading
system/gd/hci/Android.bp +0 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ filegroup { "link_key.cc", "remote_name_request.cc", "uuid.cc", "vendor_specific_event_manager.cc", ], } Loading
system/gd/hci/BUILD.gn +0 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,6 @@ source_set("BluetoothHciSources") { "msft.cc", "remote_name_request.cc", "uuid.cc", "vendor_specific_event_manager.cc", ] include_dirs = [ "//bt/system/gd" ] Loading
system/gd/hci/hci_interface.h +6 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,12 @@ class HciInterface : public CommandInterface<CommandBuilder> { virtual void UnregisterLeEventHandler(SubeventCode subevent_code) = 0; virtual void RegisterVendorSpecificEventHandler( VseSubeventCode subevent_code, common::ContextualCallback<void(VendorSpecificEventView)> event_handler) = 0; virtual void UnregisterVendorSpecificEventHandler(VseSubeventCode subevent_code) = 0; virtual void RegisterForDisconnects( common::ContextualCallback<void(uint16_t, hci::ErrorCode)> on_disconnect) = 0; Loading