From 7be720dc74efb28dccc71be145a4e54e080352dc Mon Sep 17 00:00:00 2001 From: Francis Tsui Date: Tue, 16 Dec 2025 10:31:17 -0800 Subject: [PATCH] Deprecate sender_skips_confirmation flag. PiperOrigin-RevId: 845337256 --- .../flags/generated/nearby_sharing_feature_flags.h | 4 ---- sharing/nearby_sharing_service_impl.cc | 13 +++---------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/sharing/flags/generated/nearby_sharing_feature_flags.h b/sharing/flags/generated/nearby_sharing_feature_flags.h index 83d301f6..a940256d 100755 --- a/sharing/flags/generated/nearby_sharing_feature_flags.h +++ b/sharing/flags/generated/nearby_sharing_feature_flags.h @@ -58,9 +58,6 @@ constexpr auto kEnableSendingDesktopEvents = // 2, FATAL: 3, negative values are -(verbosity level). constexpr auto kLoggingLevel = flags::Flag(kConfigPackage, "45401358", 1); -// When true, the sender will not require confirming the ukey2 token. -constexpr auto kSenderSkipsConfirmation = - flags::Flag(kConfigPackage, "45411353", true); // Enable/disable auto-update on settings page constexpr auto kShowAutoUpdateSetting = flags::Flag(kConfigPackage, "45409033", false); @@ -120,7 +117,6 @@ inline absl::btree_map&> GetBoolFlags() { {45411589, kEnableRetryResumeTransfer}, {45418908, kEnableSelfShareUi}, {45459748, kEnableSendingDesktopEvents}, - {45411353, kSenderSkipsConfirmation}, {45409033, kShowAutoUpdateSetting}, {45630055, kUseGrpcClient}, {45657036, kDeleteUnexpectedReceivedFileFix}, diff --git a/sharing/nearby_sharing_service_impl.cc b/sharing/nearby_sharing_service_impl.cc index b9b5833a..efc2eefd 100644 --- a/sharing/nearby_sharing_service_impl.cc +++ b/sharing/nearby_sharing_service_impl.cc @@ -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 {