Add EnableNearbyBackendTitaniumConfig flag.

PiperOrigin-RevId: 817413858
This commit is contained in:
Francis Tsui
2025-10-09 18:13:51 -07:00
committed by Copybara-Service
parent 0d207bc95b
commit 585734283e
2 changed files with 11 additions and 1 deletions
@@ -76,6 +76,9 @@ constexpr auto kDeleteUnexpectedReceivedFileFix =
// The default time in milliseconds a cached entry can be in LOST state.
constexpr auto kDiscoveryCacheLostExpiryMs =
flags::Flag<int64_t>(kConfigPackage, "45658774", 500);
// When true, use the Titanium flag from the Nearby backend.
constexpr auto kEnableNearbyBackendTitaniumConfig =
flags::Flag<bool>(kConfigPackage, "45731874", false);
// When true, enable Nearby Share gRPC async client.
constexpr auto kEnableNearbyShareGrpcAsyncClient =
flags::Flag<bool>(kConfigPackage, "45726584", false);
@@ -134,6 +137,7 @@ inline absl::btree_map<int, const flags::Flag<bool>&> GetBoolFlags() {
{45409033, kShowAutoUpdateSetting},
{45630055, kUseGrpcClient},
{45657036, kDeleteUnexpectedReceivedFileFix},
{45731874, kEnableNearbyBackendTitaniumConfig},
{45726584, kEnableNearbyShareGrpcAsyncClient},
{45673628, kEnableWifiHotspotForHpRealtekDevices},
{45683539, kUseAlternateServiceUuidForDiscovery},
+7 -1
View File
@@ -2614,11 +2614,17 @@ void NearbySharingServiceImpl::OnOutgoingConnectionKeyVerificationDone(
!NearbyFlags::GetInstance().GetBoolFlag(
config_package_nearby::nearby_sharing_feature::
kSenderSkipsConfirmation);
bool protection_enabled = mendel_advanced_protection_enabled;
if (NearbyFlags::GetInstance().GetBoolFlag(
config_package_nearby::nearby_sharing_feature::
kEnableNearbyBackendTitaniumConfig)) {
protection_enabled = be_advanced_protection_enabled;
}
bool advanced_protection_mismatch =
(be_advanced_protection_enabled != mendel_advanced_protection_enabled);
// Continue to use mendel flag until we have confidence that the Nearby BE
// flag has the same value.
session->SetAdvancedProtectionStatus(mendel_advanced_protection_enabled,
session->SetAdvancedProtectionStatus(protection_enabled,
advanced_protection_mismatch);
if (session->token().empty() || !mendel_advanced_protection_enabled) {
// Auto accept if no token or if advanced protection is disabled.