From 10c85fe248f236d0999e22d87da2f7190c4c83eb Mon Sep 17 00:00:00 2001 From: Francis Tsui Date: Tue, 20 Jan 2026 11:13:32 -0800 Subject: [PATCH] Remove EnableBleV2 flag. PiperOrigin-RevId: 858672879 --- connections/c/nc.cc | 5 ----- connections/c/nc.h | 3 +-- .../flags/nearby_connections_feature_flags.h | 3 --- connections/swift/NearbyCoreAdapter/Sources/GNCFlags.mm | 7 +++---- 4 files changed, 4 insertions(+), 14 deletions(-) diff --git a/connections/c/nc.cc b/connections/c/nc.cc index 43ae61e2..53728843 100644 --- a/connections/c/nc.cc +++ b/connections/c/nc.cc @@ -34,7 +34,6 @@ #include "connections/connection_options.h" #include "connections/core.h" #include "connections/discovery_options.h" -#include "connections/implementation/flags/nearby_connections_feature_flags.h" #include "connections/listeners.h" #include "connections/medium_selector.h" #include "connections/out_of_band_connection_metadata.h" @@ -801,10 +800,6 @@ int NcGetLocalEndpointId(NC_INSTANCE instance) { void NcEnableBleV2(NC_INSTANCE instance, bool enable, NcCallbackResult result_callback, CALLER_CONTEXT context) { - nearby::NearbyFlags::GetInstance().OverrideBoolFlagValue( - ::nearby::connections::config_package_nearby::nearby_connections_feature:: - kEnableBleV2, - enable); result_callback(NC_STATUS_SUCCESS, context); } diff --git a/connections/c/nc.h b/connections/c/nc.h index 1265fcba..b3dd2505 100644 --- a/connections/c/nc.h +++ b/connections/c/nc.h @@ -181,8 +181,7 @@ NC_API void NcInitiateBandwidthUpgrade(NC_INSTANCE instance, int endpoint_id, // Gets the local endpoint generated by Nearby Connections. NC_API int NcGetLocalEndpointId(NC_INSTANCE instance); -// Enable/Disable BLE V2 advertising. The method should be deprecated after -// BLE V1 deprecated. +// Enable/Disable BLE V2 advertising. The method is deprecated. It's a no-op. NC_API void NcEnableBleV2(NC_INSTANCE instance, bool enable, NcCallbackResult result_callback, CALLER_CONTEXT context); diff --git a/connections/implementation/flags/nearby_connections_feature_flags.h b/connections/implementation/flags/nearby_connections_feature_flags.h index dfaded1f..1ca549d6 100644 --- a/connections/implementation/flags/nearby_connections_feature_flags.h +++ b/connections/implementation/flags/nearby_connections_feature_flags.h @@ -49,9 +49,6 @@ constexpr auto kEnableBleL2cap = // Enable/Disable BLE medium injection. constexpr auto kEnableBleMediumInjection = flags::Flag(kConfigPackage, "45743128", false); -// Disable/Enable BLE v2 in Nearby Connections SDK. -constexpr auto kEnableBleV2 = - flags::Flag(kConfigPackage, "45401515", true); // Enable/Disable DCT advertising/scanning specification. constexpr auto kEnableDct = flags::Flag(kConfigPackage, "45697202", false); diff --git a/connections/swift/NearbyCoreAdapter/Sources/GNCFlags.mm b/connections/swift/NearbyCoreAdapter/Sources/GNCFlags.mm index 7b5cb6ba..8c32211c 100644 --- a/connections/swift/NearbyCoreAdapter/Sources/GNCFlags.mm +++ b/connections/swift/NearbyCoreAdapter/Sources/GNCFlags.mm @@ -24,13 +24,12 @@ @implementation GNCFlags + (BOOL)enableBLEV2 { - return nearby::NearbyFlags::GetInstance().GetBoolFlag( - nearby::connections::config_package_nearby::nearby_connections_feature::kEnableBleV2); + // This is deprecated. It's a no-op. + return true; } + (void)setEnableBLEV2:(BOOL)value { - nearby::NearbyFlags::GetInstance().OverrideBoolFlagValue( - nearby::connections::config_package_nearby::nearby_connections_feature::kEnableBleV2, value); + // This is deprecated. It's a no-op. } @end