From f05e24f7ea5c59cb92becdf620cf869a4fb089dc Mon Sep 17 00:00:00 2001 From: Anay Wadhera Date: Thu, 29 Jun 2023 12:32:01 -0700 Subject: [PATCH] Plumb updateDiscoveryOptions into pcp handler. PiperOrigin-RevId: 544431325 --- .../implementation/base_pcp_handler.cc | 32 ++++ connections/implementation/base_pcp_handler.h | 15 ++ .../implementation/base_pcp_handler_test.cc | 170 +++++++++++++++++- connections/implementation/client_proxy.h | 5 + .../offline_service_controller.cc | 5 +- .../offline_service_controller_test.cc | 52 ++++++ .../implementation/offline_simulation_user.cc | 5 + .../implementation/offline_simulation_user.h | 4 + .../implementation/p2p_cluster_pcp_handler.h | 12 ++ connections/implementation/pcp_handler.h | 4 + connections/implementation/pcp_manager.cc | 10 ++ connections/implementation/pcp_manager.h | 4 + .../implementation/pcp_manager_test.cc | 10 ++ connections/implementation/simulation_user.cc | 4 + connections/implementation/simulation_user.h | 3 + 15 files changed, 331 insertions(+), 4 deletions(-) diff --git a/connections/implementation/base_pcp_handler.cc b/connections/implementation/base_pcp_handler.cc index f5c715a4..7d0e4b1a 100644 --- a/connections/implementation/base_pcp_handler.cc +++ b/connections/implementation/base_pcp_handler.cc @@ -1292,6 +1292,27 @@ Status BasePcpHandler::UpdateAdvertisingOptions( return status.Get().GetResult(); } +Status BasePcpHandler::UpdateDiscoveryOptions( + ClientProxy* client, absl::string_view service_id, + const DiscoveryOptions& discovery_options) { + Future status; + RunOnPcpHandlerThread( + "update-discovery-options", + [this, client, service_id, discovery_options, &status]() + RUN_ON_PCP_HANDLER_THREAD() mutable { + StartOperationResult result = UpdateDiscoveryOptionsImpl( + client, service_id, client->GetLocalEndpointId(), + client->GetLocalEndpointInfo(), discovery_options); + if (!result.status.Ok()) { + status.Set(result.status); + return; + } + client->UpdateDiscoveryOptions(discovery_options); + status.Set({Status::kSuccess}); + }); + return status.Get().GetResult(); +} + bool BasePcpHandler::NeedsToTurnOffAdvertisingMedium( Medium medium, const AdvertisingOptions& old_options, const AdvertisingOptions& new_options) { @@ -1303,6 +1324,17 @@ bool BasePcpHandler::NeedsToTurnOffAdvertisingMedium( medium) != new_disabled_mediums.end()); } +bool BasePcpHandler::NeedsToTurnOffDiscoveryMedium( + Medium medium, const DiscoveryOptions& old_options, + const DiscoveryOptions& new_options) { + auto old_enabled_mediums = old_options.allowed.GetMediums(/*value=*/true); + auto new_disabled_mediums = new_options.allowed.GetMediums(/*value=*/false); + return (std::find(old_enabled_mediums.begin(), old_enabled_mediums.end(), + medium) != old_enabled_mediums.end()) && + (std::find(new_disabled_mediums.begin(), new_disabled_mediums.end(), + medium) != new_disabled_mediums.end()); +} + bool BasePcpHandler::IsPreferred( const BasePcpHandler::DiscoveredEndpoint& new_endpoint, const BasePcpHandler::DiscoveredEndpoint& old_endpoint) { diff --git a/connections/implementation/base_pcp_handler.h b/connections/implementation/base_pcp_handler.h index 04f9acb2..9d9d77aa 100644 --- a/connections/implementation/base_pcp_handler.h +++ b/connections/implementation/base_pcp_handler.h @@ -154,6 +154,10 @@ class BasePcpHandler : public PcpHandler, ClientProxy* client, absl::string_view service_id, const AdvertisingOptions& advertising_options) override; + Status UpdateDiscoveryOptions( + ClientProxy* client, absl::string_view service_id, + const DiscoveryOptions& discovery_options) override; + Pcp GetPcp() const override { return pcp_; } Strategy GetStrategy() const override { return strategy_; } void DisconnectFromEndpointManager(); @@ -313,11 +317,22 @@ class BasePcpHandler : public PcpHandler, const AdvertisingOptions& advertising_options) RUN_ON_PCP_HANDLER_THREAD() = 0; + virtual StartOperationResult UpdateDiscoveryOptionsImpl( + ClientProxy* client, absl::string_view service_id, + absl::string_view local_endpoint_id, + absl::string_view local_endpoint_info, + const DiscoveryOptions& discovery_options) + RUN_ON_PCP_HANDLER_THREAD() = 0; + bool NeedsToTurnOffAdvertisingMedium( location::nearby::proto::connections::Medium medium, const AdvertisingOptions& old_options, const AdvertisingOptions& new_options); + bool NeedsToTurnOffDiscoveryMedium( + location::nearby::proto::connections::Medium medium, + const DiscoveryOptions& old_options, const DiscoveryOptions& new_options); + virtual std::vector GetConnectionMediumsByPriority() = 0; virtual location::nearby::proto::connections::Medium diff --git a/connections/implementation/base_pcp_handler_test.cc b/connections/implementation/base_pcp_handler_test.cc index fd0c2636..8c9168e4 100644 --- a/connections/implementation/base_pcp_handler_test.cc +++ b/connections/implementation/base_pcp_handler_test.cc @@ -24,6 +24,7 @@ #include "gtest/gtest.h" #include "absl/strings/string_view.h" #include "absl/time/time.h" +#include "connections/discovery_options.h" #include "connections/implementation/base_endpoint_channel.h" #include "connections/implementation/bwu_manager.h" #include "connections/implementation/client_proxy.h" @@ -177,6 +178,10 @@ class MockPcpHandler : public BasePcpHandler { (ClientProxy*, absl::string_view, absl::string_view, absl::string_view, const AdvertisingOptions&), (override)); + MOCK_METHOD(StartOperationResult, UpdateDiscoveryOptionsImpl, + (ClientProxy*, absl::string_view, absl::string_view, + absl::string_view, const DiscoveryOptions&), + (override)); std::vector GetConnectionMediumsByPriority() override { @@ -250,6 +255,14 @@ class MockPcpHandler : public BasePcpHandler { return BasePcpHandler::NeedsToTurnOffAdvertisingMedium(medium, old_options, new_options); } + + bool NeedsToTurnOffDiscoveryMedium( + location::nearby::proto::connections::Medium medium, + const DiscoveryOptions& old_options, + const DiscoveryOptions& new_options) { + return BasePcpHandler::NeedsToTurnOffDiscoveryMedium(medium, old_options, + new_options); + } }; class MockContext { @@ -356,7 +369,6 @@ class BasePcpHandlerTest void StartDiscovery(ClientProxy* client, MockPcpHandler* pcp_handler, BooleanMediumSelector allowed = GetParam()) { - std::string service_id{"service"}; DiscoveryOptions discovery_options{ { Strategy::kP2pCluster, @@ -365,10 +377,18 @@ class BasePcpHandlerTest true, // auto_upgrade_bandwidth true, // enforce_topology_constraints }; + StartDiscoveryWithOptions(client, pcp_handler, discovery_options); + } + + void StartDiscoveryWithOptions(ClientProxy* client, + MockPcpHandler* pcp_handler, + const DiscoveryOptions& discovery_options) { + std::string service_id("service"); EXPECT_CALL(*pcp_handler, StartDiscoveryImpl(client, service_id, _)) .WillOnce(Return(MockPcpHandler::StartOperationResult{ .status = {Status::kSuccess}, - .mediums = pcp_handler->GetMediumsFromSelector(allowed), + .mediums = + pcp_handler->GetMediumsFromSelector(discovery_options.allowed), })); EXPECT_EQ(pcp_handler->StartDiscovery(client, service_id, discovery_options, discovery_listener_), @@ -376,6 +396,17 @@ class BasePcpHandlerTest EXPECT_TRUE(client->IsDiscovering()); } + void UpdateDiscoveryOptions(ClientProxy* client, MockPcpHandler* pcp_handler, + DiscoveryOptions new_options, + Status expected_status) { + EXPECT_CALL(*pcp_handler, UpdateDiscoveryOptionsImpl) + .WillOnce(Return(MockPcpHandler::StartOperationResult{ + .status = expected_status, + .mediums = pcp_handler->GetMediumsFromSelector(new_options.allowed), + })); + pcp_handler->UpdateDiscoveryOptions(client, "service", new_options); + } + std::pair, std::unique_ptr> SetupConnection( @@ -1470,6 +1501,141 @@ TEST_F(BasePcpHandlerTest, TestUpdateAdvertisingOptionsFailsWithBadStatus) { env_.Stop(); } +TEST_F(BasePcpHandlerTest, TestNeedsToTurnOffDiscoveryMedium) { + Mediums m; + EndpointChannelManager ecm; + EndpointManager em(&ecm); + BwuManager bwu(m, em, ecm, {}, {}); + MockPcpHandler pcp_handler(&m, &em, &ecm, &bwu); + BooleanMediumSelector old_meds{ + .bluetooth = true, + .ble = true, + .wifi_lan = false, + }; + DiscoveryOptions old_opts, new_opts; + old_opts.allowed = old_meds; + BooleanMediumSelector new_meds{ + .bluetooth = false, + .ble = true, + .wifi_lan = false, + }; + new_opts.allowed = new_meds; + EXPECT_TRUE(pcp_handler.NeedsToTurnOffDiscoveryMedium(Medium::BLUETOOTH, + old_opts, new_opts)); + EXPECT_FALSE(pcp_handler.NeedsToTurnOffDiscoveryMedium(Medium::BLE, old_opts, + new_opts)); + EXPECT_FALSE(pcp_handler.NeedsToTurnOffDiscoveryMedium(Medium::WIFI_LAN, + old_opts, new_opts)); +} + +TEST_F(BasePcpHandlerTest, TestUpdateDiscoveryOptionsWorks) { + env_.Start(); + DiscoveryOptions old_options{ + {}, + true, // auto_upgrade_bandwidth + true, // enforce_topology_constraints + false, // is_out_of_band_connection, + "", // fast_advertisement_service_uuid + false, // low_power + }; + DiscoveryOptions new_options{ + {}, + true, // auto_upgrade_bandwidth + true, // enforce_topology_constraints + false, // is_out_of_band_connection, + "", // fast_advertisement_service_uuid + true, // low_power + }; + ClientProxy client; + Mediums m; + EndpointChannelManager ecm; + EndpointManager em(&ecm); + BwuManager bwu(m, em, ecm, {}, {}); + MockPcpHandler pcp_handler(&m, &em, &ecm, &bwu); + StartDiscoveryWithOptions(&client, &pcp_handler, old_options); + EXPECT_TRUE(client.IsDiscovering()); + auto current_client_opts = client.GetDiscoveryOptions(); + // check custom option parameters + EXPECT_EQ(current_client_opts.auto_upgrade_bandwidth, + old_options.auto_upgrade_bandwidth); + EXPECT_EQ(current_client_opts.enforce_topology_constraints, + old_options.enforce_topology_constraints); + EXPECT_EQ(current_client_opts.low_power, old_options.low_power); + EXPECT_EQ(current_client_opts.is_out_of_band_connection, + old_options.is_out_of_band_connection); + EXPECT_EQ(current_client_opts.fast_advertisement_service_uuid, + old_options.fast_advertisement_service_uuid); + UpdateDiscoveryOptions(&client, &pcp_handler, new_options, + {Status::kSuccess}); + EXPECT_TRUE(client.IsDiscovering()); + current_client_opts = client.GetDiscoveryOptions(); + // check new option parameters + EXPECT_EQ(current_client_opts.auto_upgrade_bandwidth, + new_options.auto_upgrade_bandwidth); + EXPECT_EQ(current_client_opts.enforce_topology_constraints, + new_options.enforce_topology_constraints); + EXPECT_EQ(current_client_opts.low_power, new_options.low_power); + EXPECT_EQ(current_client_opts.is_out_of_band_connection, + new_options.is_out_of_band_connection); + EXPECT_EQ(current_client_opts.fast_advertisement_service_uuid, + new_options.fast_advertisement_service_uuid); + env_.Stop(); +} + +TEST_F(BasePcpHandlerTest, TestUpdateDiscoveryOptionsFailsWithBadStatus) { + env_.Start(); + DiscoveryOptions old_options{ + {}, + true, // auto_upgrade_bandwidth + true, // enforce_topology_constraints + false, // is_out_of_band_connection, + "", // fast_advertisement_service_uuid + false, // low_power + }; + DiscoveryOptions new_options{ + {}, + true, // auto_upgrade_bandwidth + true, // enforce_topology_constraints + false, // is_out_of_band_connection, + "", // fast_advertisement_service_uuid + true, // low_power + }; + ClientProxy client; + Mediums m; + EndpointChannelManager ecm; + EndpointManager em(&ecm); + BwuManager bwu(m, em, ecm, {}, {}); + MockPcpHandler pcp_handler(&m, &em, &ecm, &bwu); + StartDiscoveryWithOptions(&client, &pcp_handler, old_options); + EXPECT_TRUE(client.IsDiscovering()); + auto current_client_opts = client.GetDiscoveryOptions(); + // check custom option parameters + EXPECT_EQ(current_client_opts.auto_upgrade_bandwidth, + old_options.auto_upgrade_bandwidth); + EXPECT_EQ(current_client_opts.enforce_topology_constraints, + old_options.enforce_topology_constraints); + EXPECT_EQ(current_client_opts.low_power, old_options.low_power); + EXPECT_EQ(current_client_opts.is_out_of_band_connection, + old_options.is_out_of_band_connection); + EXPECT_EQ(current_client_opts.fast_advertisement_service_uuid, + old_options.fast_advertisement_service_uuid); + UpdateDiscoveryOptions(&client, &pcp_handler, new_options, + {Status::kBleError}); + EXPECT_TRUE(client.IsDiscovering()); + current_client_opts = client.GetDiscoveryOptions(); + // check new option parameters + EXPECT_EQ(current_client_opts.auto_upgrade_bandwidth, + old_options.auto_upgrade_bandwidth); + EXPECT_EQ(current_client_opts.enforce_topology_constraints, + old_options.enforce_topology_constraints); + EXPECT_EQ(current_client_opts.low_power, old_options.low_power); + EXPECT_EQ(current_client_opts.is_out_of_band_connection, + old_options.is_out_of_band_connection); + EXPECT_EQ(current_client_opts.fast_advertisement_service_uuid, + old_options.fast_advertisement_service_uuid); + env_.Stop(); +} + } // namespace } // namespace connections } // namespace nearby diff --git a/connections/implementation/client_proxy.h b/connections/implementation/client_proxy.h index 3e0106f2..90032f24 100644 --- a/connections/implementation/client_proxy.h +++ b/connections/implementation/client_proxy.h @@ -129,6 +129,11 @@ class ClientProxy final { advertising_options_ = advertising_options; } + void UpdateDiscoveryOptions(const DiscoveryOptions& discovery_options) { + MutexLock lock(&mutex_); + discovery_options_ = discovery_options; + } + // Proxies to the client's DiscoveryListener::OnEndpointFound() callback. void OnEndpointFound(const std::string& service_id, const std::string& endpoint_id, diff --git a/connections/implementation/offline_service_controller.cc b/connections/implementation/offline_service_controller.cc index 4198dccd..edd2cce5 100644 --- a/connections/implementation/offline_service_controller.cc +++ b/connections/implementation/offline_service_controller.cc @@ -169,8 +169,9 @@ Status OfflineServiceController::UpdateAdvertisingOptions( Status OfflineServiceController::UpdateDiscoveryOptions( ClientProxy* client, absl::string_view service_id, const DiscoveryOptions& discovery_options) { - // TODO(b/284048592): Implement. - return {Status::kError}; + if (stop_) return {Status::kOutOfOrderApiCall}; + return pcp_manager_.UpdateDiscoveryOptions(client, service_id, + discovery_options); } void OfflineServiceController::SetCustomSavePath(ClientProxy* client, diff --git a/connections/implementation/offline_service_controller_test.cc b/connections/implementation/offline_service_controller_test.cc index 8d15d86b..c535d3ae 100644 --- a/connections/implementation/offline_service_controller_test.cc +++ b/connections/implementation/offline_service_controller_test.cc @@ -428,6 +428,58 @@ TEST_P(OfflineServiceControllerTest, TestNoUpdateAdvertisingOptionsAfterStop) { env_.Stop(); } +TEST_P(OfflineServiceControllerTest, TestUpdateDiscoveryOptions) { + env_.Start(); + OfflineSimulationUser user_a(kDeviceA, GetParam()); + EXPECT_FALSE(user_a.IsDiscovering()); + EXPECT_THAT(user_a.StartDiscovery(std::string(kServiceId), nullptr), + Eq(Status{Status::kSuccess})); + EXPECT_TRUE(user_a.IsDiscovering()); + DiscoveryOptions new_options = { + { + Strategy::kP2pCluster, + GetParam(), + }, + false, // auto_upgrade_bandwidth + false, // enforce_topology_constraints + true, // is_out_of_band_connection + "", // fast_advertisement_service_uuid + true, // low_power + }; + // TODO(b/284048592): Change to kSuccess when implemented. + EXPECT_THAT(user_a.UpdateDiscoveryOptions(kServiceId, new_options), + Eq(Status{Status::kError})); + EXPECT_TRUE(user_a.IsDiscovering()); + user_a.Stop(); + env_.Stop(); +} + +TEST_P(OfflineServiceControllerTest, TestNoUpdateDiscoveryOptionsAfterStop) { + env_.Start(); + OfflineSimulationUser user_a(kDeviceA, GetParam()); + EXPECT_FALSE(user_a.IsDiscovering()); + EXPECT_THAT(user_a.StartDiscovery(std::string(kServiceId), nullptr), + Eq(Status{Status::kSuccess})); + EXPECT_TRUE(user_a.IsDiscovering()); + DiscoveryOptions new_options = { + { + Strategy::kP2pCluster, + GetParam(), + }, + false, // auto_upgrade_bandwidth + false, // enforce_topology_constraints + true, // is_out_of_band_connection + "", // fast_advertisement_service_uuid + true, // low_power + }; + user_a.Stop(); + EXPECT_FALSE(user_a.IsDiscovering()); + EXPECT_THAT(user_a.UpdateDiscoveryOptions(kServiceId, new_options), + Eq(Status{Status::kOutOfOrderApiCall})); + EXPECT_FALSE(user_a.IsDiscovering()); + env_.Stop(); +} + INSTANTIATE_TEST_SUITE_P(ParametrisedOfflineServiceControllerTest, OfflineServiceControllerTest, ::testing::ValuesIn(kTestCases)); diff --git a/connections/implementation/offline_simulation_user.cc b/connections/implementation/offline_simulation_user.cc index 2880471e..03cfaa80 100644 --- a/connections/implementation/offline_simulation_user.cc +++ b/connections/implementation/offline_simulation_user.cc @@ -152,6 +152,11 @@ Status OfflineSimulationUser::StartDiscovery(const std::string& service_id, void OfflineSimulationUser::StopDiscovery() { ctrl_.StopDiscovery(&client_); } +Status OfflineSimulationUser::UpdateDiscoveryOptions( + absl::string_view service_id, const DiscoveryOptions& options) { + return ctrl_.UpdateDiscoveryOptions(&client_, service_id, options); +} + void OfflineSimulationUser::InjectEndpoint( const std::string& service_id, const OutOfBandConnectionMetadata& metadata) { diff --git a/connections/implementation/offline_simulation_user.h b/connections/implementation/offline_simulation_user.h index 09a5618e..af92d05b 100644 --- a/connections/implementation/offline_simulation_user.h +++ b/connections/implementation/offline_simulation_user.h @@ -94,6 +94,10 @@ class OfflineSimulationUser { // Calls PcpManager::StopDiscovery(). void StopDiscovery(); + // Calls PcpManager::UpdateDiscoveryOptions(). + Status UpdateDiscoveryOptions(absl::string_view service_id, + const DiscoveryOptions& options); + // Calls PcpManager::InjectEndpoint(); void InjectEndpoint(const std::string& service_id, const OutOfBandConnectionMetadata& metadata); diff --git a/connections/implementation/p2p_cluster_pcp_handler.h b/connections/implementation/p2p_cluster_pcp_handler.h index c2b563c9..ac44ebf6 100644 --- a/connections/implementation/p2p_cluster_pcp_handler.h +++ b/connections/implementation/p2p_cluster_pcp_handler.h @@ -108,6 +108,18 @@ class P2pClusterPcpHandler : public BasePcpHandler { absl::string_view local_endpoint_info, const AdvertisingOptions& advertising_options) override; + // @PCPHandlerThread + BasePcpHandler::StartOperationResult UpdateDiscoveryOptionsImpl( + ClientProxy* client, absl::string_view service_id, + absl::string_view local_endpoint_id, + absl::string_view local_endpoint_info, + const DiscoveryOptions& discovery_options) override { + // TODO(b/284048592): Implement. + return StartOperationResult { + .status = {Status::kError}, + }; + } + private: // Holds the state required to re-create a BleEndpoint we see on a // BlePeripheral, so BlePeripheralLostHandler can call diff --git a/connections/implementation/pcp_handler.h b/connections/implementation/pcp_handler.h index 5e05bcb0..8a738e8f 100644 --- a/connections/implementation/pcp_handler.h +++ b/connections/implementation/pcp_handler.h @@ -125,6 +125,10 @@ class PcpHandler { virtual Status UpdateAdvertisingOptions( ClientProxy* client, absl::string_view service_id, const AdvertisingOptions& advertising_options) = 0; + + virtual Status UpdateDiscoveryOptions( + ClientProxy* client, absl::string_view service_id, + const DiscoveryOptions& discovery_options) = 0; }; } // namespace connections diff --git a/connections/implementation/pcp_manager.cc b/connections/implementation/pcp_manager.cc index dd91b126..2c78f57c 100644 --- a/connections/implementation/pcp_manager.cc +++ b/connections/implementation/pcp_manager.cc @@ -157,6 +157,16 @@ Status PcpManager::UpdateAdvertisingOptions( advertising_options); } +Status PcpManager::UpdateDiscoveryOptions( + ClientProxy* client, absl::string_view service_id, + const DiscoveryOptions& discovery_options) { + if (!current_) { + return {Status::kOutOfOrderApiCall}; + } + return current_->UpdateDiscoveryOptions(client, service_id, + discovery_options); +} + bool PcpManager::SetCurrentPcpHandler(Strategy strategy) { current_ = GetPcpHandler(StrategyToPcp(strategy)); diff --git a/connections/implementation/pcp_manager.h b/connections/implementation/pcp_manager.h index d01931ce..5e59a6c5 100644 --- a/connections/implementation/pcp_manager.h +++ b/connections/implementation/pcp_manager.h @@ -79,6 +79,10 @@ class PcpManager { ClientProxy* client, absl::string_view service_id, const AdvertisingOptions& advertising_options); + Status UpdateDiscoveryOptions(ClientProxy* client, + absl::string_view service_id, + const DiscoveryOptions& discovery_options); + location::nearby::proto::connections::Medium GetBandwidthUpgradeMedium(); void DisconnectFromEndpointManager(); diff --git a/connections/implementation/pcp_manager_test.cc b/connections/implementation/pcp_manager_test.cc index bce86e21..fddc8d5b 100644 --- a/connections/implementation/pcp_manager_test.cc +++ b/connections/implementation/pcp_manager_test.cc @@ -221,6 +221,16 @@ TEST_F(PcpManagerTest, InjectEndpoint) { env_.Stop(); } +TEST_F(PcpManagerTest, TestUpdateDiscoveryFailsWithoutPcpHandler) { + BooleanMediumSelector selector; + selector.SetAll(true); + env_.Start(); + SimulationUser user_a(kDeviceA, selector); + EXPECT_EQ(user_a.UpdateDiscoveryOptions(kServiceId).value, + Status::Value::kOutOfOrderApiCall); + env_.Stop(); +} + } // namespace } // namespace connections } // namespace nearby diff --git a/connections/implementation/simulation_user.cc b/connections/implementation/simulation_user.cc index de0cc2f6..75b384a5 100644 --- a/connections/implementation/simulation_user.cc +++ b/connections/implementation/simulation_user.cc @@ -129,6 +129,10 @@ void SimulationUser::StartDiscovery(const std::string& service_id, .Ok()); } +Status SimulationUser::UpdateDiscoveryOptions(absl::string_view service_id) { + return mgr_.UpdateDiscoveryOptions(&client_, service_id, discovery_options_); +} + void SimulationUser::InjectEndpoint( const std::string& service_id, const OutOfBandConnectionMetadata& metadata) { diff --git a/connections/implementation/simulation_user.h b/connections/implementation/simulation_user.h index 3dce065e..2e10d8f0 100644 --- a/connections/implementation/simulation_user.h +++ b/connections/implementation/simulation_user.h @@ -91,6 +91,9 @@ class SimulationUser { // callback. void StartDiscovery(const std::string& service_id, CountDownLatch* latch); + // Calls PcpManager::UpdateDiscoveryOptions. + Status UpdateDiscoveryOptions(absl::string_view service_id); + // Calls PcpManager::InjectEndpoint. void InjectEndpoint(const std::string& service_id, const OutOfBandConnectionMetadata& metadata);