From 60d0c85d532449aee379a79b880e2ac508291127 Mon Sep 17 00:00:00 2001 From: Francis Tsui Date: Thu, 9 Oct 2025 18:11:53 -0700 Subject: [PATCH] Add flag for DHCP renewal PiperOrigin-RevId: 817413881 --- internal/platform/flags/nearby_platform_feature_flags.h | 4 ++++ .../platform/implementation/windows/wifi_hotspot_medium.cc | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/internal/platform/flags/nearby_platform_feature_flags.h b/internal/platform/flags/nearby_platform_feature_flags.h index 00e9d9f1..9259140b 100644 --- a/internal/platform/flags/nearby_platform_feature_flags.h +++ b/internal/platform/flags/nearby_platform_feature_flags.h @@ -53,6 +53,10 @@ constexpr auto kWifiHotspotConnectionIntervalMillis = constexpr auto kWifiHotspotConnectionTimeoutMillis = flags::Flag(kConfigPackage, "45415888", 10000); +// Enable/Disable DHCP renewal when connecting to hotspot. +constexpr auto kEnableHotspotDhcpRenew = + flags::Flag(kConfigPackage, "45731858", false); + // Enable/Disable Intel PIe SDK to query/set WIFI feature. constexpr auto kEnableIntelPieSdk = flags::Flag(kConfigPackage, "45428547", false); diff --git a/internal/platform/implementation/windows/wifi_hotspot_medium.cc b/internal/platform/implementation/windows/wifi_hotspot_medium.cc index 037c148d..951e1459 100644 --- a/internal/platform/implementation/windows/wifi_hotspot_medium.cc +++ b/internal/platform/implementation/windows/wifi_hotspot_medium.cc @@ -449,8 +449,11 @@ bool WifiHotspotMedium::ConnectWifiHotspot( LOG(INFO) << "Check IP address at attempt " << i; if (!wifi_hotspot_native_.HasAssignedAddress()) { - // TODO: ftsui - Add flag to control this. - wifi_hotspot_native_.RenewIpv4Address(); + if (NearbyFlags::GetInstance().GetBoolFlag( + platform::config_package_nearby::nearby_platform_feature:: + kEnableHotspotDhcpRenew)) { + wifi_hotspot_native_.RenewIpv4Address(); + } Sleep(ip_address_retry_interval_millis); continue; }