mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Deprecate flag kIgnoreUpgradePathAvailableFrameForAdvertiser
PiperOrigin-RevId: 659123571
This commit is contained in:
committed by
Copybara-Service
parent
a8757a2c49
commit
26d5055b13
@@ -718,10 +718,7 @@ void BwuManager::ProcessBwuPathAvailableEvent(
|
||||
return;
|
||||
}
|
||||
|
||||
if (NearbyFlags::GetInstance().GetBoolFlag(
|
||||
config_package_nearby::nearby_connections_feature::
|
||||
kIgnoreUpgradePathAvailableFrameForAdvertiser) &&
|
||||
client->IsIncomingConnection(endpoint_id)) {
|
||||
if (client->IsIncomingConnection(endpoint_id)) {
|
||||
NEARBY_LOGS(INFO)
|
||||
<< "ProcessBandwidthUpgradePathAvailableEvent ignored by Advertiser";
|
||||
return;
|
||||
|
||||
@@ -1002,12 +1002,6 @@ TEST_F(BwuManagerTest, BlockBwuFrameBeforeAccept) {
|
||||
}
|
||||
|
||||
TEST_F(BwuManagerTest, BlockBwuFrameFromAdvertiser) {
|
||||
NearbyFlags::GetInstance().OverrideBoolFlagValue(
|
||||
config_package_nearby::nearby_connections_feature::
|
||||
kIgnoreUpgradePathAvailableFrameForAdvertiser,
|
||||
false);
|
||||
CreateInitialEndpoint(kServiceIdA, kEndpointId1, Medium::BLUETOOTH);
|
||||
|
||||
ExceptionOr<OfflineFrame> hotspot_path_available_frame =
|
||||
parser::FromBytes(parser::ForBwuWifiHotspotPathAvailable(
|
||||
/*ssid=*/"Direct-357a2d8c", /*password=*/"b592f7d3",
|
||||
@@ -1019,6 +1013,8 @@ TEST_F(BwuManagerTest, BlockBwuFrameFromAdvertiser) {
|
||||
sub_frame->set_event_type(
|
||||
BandwidthUpgradeNegotiationFrame::UPGRADE_PATH_AVAILABLE);
|
||||
auto* upgrade_path_info = sub_frame->mutable_upgrade_path_info();
|
||||
upgrade_path_info->set_supports_client_introduction_ack(false);
|
||||
upgrade_path_info->set_supports_disabling_encryption(true);
|
||||
|
||||
ConnectionResponseInfo response_info{
|
||||
.remote_endpoint_info = ByteArray{"endpoint_name"},
|
||||
@@ -1027,28 +1023,7 @@ TEST_F(BwuManagerTest, BlockBwuFrameFromAdvertiser) {
|
||||
.is_incoming_connection = true,
|
||||
};
|
||||
ConnectionOptions connection_options;
|
||||
client_.OnConnectionInitiated(std::string(kEndpointId1), response_info,
|
||||
connection_options, {}, "token");
|
||||
client_.LocalEndpointAcceptedConnection(std::string(kEndpointId1), {});
|
||||
client_.RemoteEndpointAcceptedConnection(std::string(kEndpointId1));
|
||||
EXPECT_TRUE(client_.IsConnectionAccepted(std::string(kEndpointId1)));
|
||||
client_.OnConnectionAccepted(std::string(kEndpointId1));
|
||||
EXPECT_TRUE(client_.IsConnectedToEndpoint(std::string(kEndpointId1)));
|
||||
|
||||
upgrade_path_info->set_supports_client_introduction_ack(false);
|
||||
upgrade_path_info->set_supports_disabling_encryption(true);
|
||||
bwu_manager_->OnIncomingFrame(frame, std::string(kEndpointId1), &client_,
|
||||
Medium::BLUETOOTH, packet_meta_data_);
|
||||
CountDownLatch latch(1);
|
||||
// The BWU frame should not be drop, so the IsUpgradeOngoing should not be
|
||||
// empty.
|
||||
ASSERT_EQ(bwu_manager_->IsUpgradeOngoing(std::string(kEndpointId1)), true);
|
||||
UnRegisterChannelForEndpoint(kEndpointId1);
|
||||
|
||||
NearbyFlags::GetInstance().OverrideBoolFlagValue(
|
||||
config_package_nearby::nearby_connections_feature::
|
||||
kIgnoreUpgradePathAvailableFrameForAdvertiser,
|
||||
true);
|
||||
CreateInitialEndpoint(kServiceIdA, kEndpointId2, Medium::BLUETOOTH);
|
||||
|
||||
client_.OnConnectionInitiated(std::string(kEndpointId2), response_info,
|
||||
|
||||
@@ -74,10 +74,6 @@ constexpr auto kCheckIllegalCharacters =
|
||||
constexpr auto kEnableMultiplex =
|
||||
flags::Flag<bool>(kConfigPackage, "45627836", false);
|
||||
|
||||
// When true, allows to ignore the upgrade path available frame for advertiser.
|
||||
constexpr auto kIgnoreUpgradePathAvailableFrameForAdvertiser =
|
||||
flags::Flag<bool>(kConfigPackage, "45633895", false);
|
||||
|
||||
// When true, use the medium in connection info.
|
||||
constexpr auto kUseMediumInConnectionInfo =
|
||||
flags::Flag<bool>(kConfigPackage, "45635058", false);
|
||||
|
||||
Reference in New Issue
Block a user