Deprecate sender_skips_confirmation flag.

PiperOrigin-RevId: 845337256
This commit is contained in:
Francis Tsui
2025-12-16 10:32:38 -08:00
committed by Copybara-Service
parent d53613f38e
commit 7be720dc74
2 changed files with 3 additions and 14 deletions
@@ -58,9 +58,6 @@ constexpr auto kEnableSendingDesktopEvents =
// 2, FATAL: 3, negative values are -(verbosity level).
constexpr auto kLoggingLevel =
flags::Flag<int64_t>(kConfigPackage, "45401358", 1);
// When true, the sender will not require confirming the ukey2 token.
constexpr auto kSenderSkipsConfirmation =
flags::Flag<bool>(kConfigPackage, "45411353", true);
// Enable/disable auto-update on settings page
constexpr auto kShowAutoUpdateSetting =
flags::Flag<bool>(kConfigPackage, "45409033", false);
@@ -120,7 +117,6 @@ inline absl::btree_map<int, const flags::Flag<bool>&> GetBoolFlags() {
{45411589, kEnableRetryResumeTransfer},
{45418908, kEnableSelfShareUi},
{45459748, kEnableSendingDesktopEvents},
{45411353, kSenderSkipsConfirmation},
{45409033, kShowAutoUpdateSetting},
{45630055, kUseGrpcClient},
{45657036, kDeleteUnexpectedReceivedFileFix},
+3 -10
View File
@@ -2524,19 +2524,12 @@ void NearbySharingServiceImpl::OnOutgoingConnectionKeyVerificationDone(
return;
}
// Auto Accept if key verification is successful or skip sender confirmation.
bool be_advanced_protection_enabled =
bool protection_enabled =
preference_manager_.GetBoolean(PrefNames::kAdvancedProtectionEnabled,
/*default_value=*/false);
bool mendel_advanced_protection_enabled =
!NearbyFlags::GetInstance().GetBoolFlag(
config_package_nearby::nearby_sharing_feature::
kSenderSkipsConfirmation);
bool protection_enabled = be_advanced_protection_enabled;
bool advanced_protection_mismatch =
(be_advanced_protection_enabled != mendel_advanced_protection_enabled);
session->SetAdvancedProtectionStatus(protection_enabled,
advanced_protection_mismatch);
if (session->token().empty() || !mendel_advanced_protection_enabled) {
/*advanced_protection_mismatch=*/false);
if (session->token().empty() || !protection_enabled) {
// Auto accept if no token or if advanced protection is disabled.
OutgoingSessionAccept(*session);
} else {