Add flag for DHCP renewal

PiperOrigin-RevId: 817413881
This commit is contained in:
Francis Tsui
2025-10-09 18:18:02 -07:00
committed by Copybara-Service
parent 585734283e
commit 60d0c85d53
2 changed files with 9 additions and 2 deletions
@@ -53,6 +53,10 @@ constexpr auto kWifiHotspotConnectionIntervalMillis =
constexpr auto kWifiHotspotConnectionTimeoutMillis =
flags::Flag<int64_t>(kConfigPackage, "45415888", 10000);
// Enable/Disable DHCP renewal when connecting to hotspot.
constexpr auto kEnableHotspotDhcpRenew =
flags::Flag<bool>(kConfigPackage, "45731858", false);
// Enable/Disable Intel PIe SDK to query/set WIFI feature.
constexpr auto kEnableIntelPieSdk =
flags::Flag<bool>(kConfigPackage, "45428547", false);
@@ -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;
}