Move hotspot credential construction into each platform.

PiperOrigin-RevId: 826272274
This commit is contained in:
Francis Tsui
2025-10-30 18:58:19 -07:00
committed by Copybara-Service
parent 03474168b5
commit ca1ab209b7
8 changed files with 66 additions and 56 deletions
@@ -134,9 +134,7 @@ HotspotCredentials* WifiHotspot::GetCredentials(absl::string_view service_id) {
<< ". Use default credentials";
return crendential;
}
crendential->SetGateway(it->second.GetIPAddress());
crendential->SetPort(it->second.GetPort());
it->second.PopulateHotspotCredentials(*crendential);
return crendential;
}
@@ -165,7 +163,7 @@ bool WifiHotspot::StartAcceptingConnections(
}
// "port=0" to let the platform to select an available port for the socket
WifiHotspotServerSocket server_socket = medium_.ListenForService(/*port=*/0);
WifiHotspotServerSocket server_socket = medium_.ListenForService();
if (!server_socket.IsValid()) {
LOG(INFO)
<< "Failed to start accepting WifiHotspot connections for service_id="