Remove unused field from HotspotCredentials.

PiperOrigin-RevId: 823606909
This commit is contained in:
Francis Tsui
2025-10-24 11:38:45 -07:00
committed by Copybara-Service
parent 9ccfded727
commit e99faba5fc
4 changed files with 6 additions and 12 deletions
@@ -135,7 +135,6 @@ HotspotCredentials* WifiHotspot::GetCredentials(absl::string_view service_id) {
return crendential;
}
crendential->SetGateway(it->second.GetIPAddress());
crendential->SetIPAddress(it->second.GetIPAddress());
crendential->SetPort(it->second.GetPort());
return crendential;
+1 -1
View File
@@ -1045,7 +1045,7 @@ api::WifiHotspotMedium* MediumEnvironment::GetWifiHotspotMedium(
if (info.is_ap && info.hotspot_credentials) {
if ((info.hotspot_credentials->GetSSID() == ssid) ||
(!ip_address.empty() &&
(info.hotspot_credentials->GetIPAddress() == ip_address))) {
(info.hotspot_credentials->GetGateway() == ip_address))) {
LOG(INFO) << "Found Remote WifiHotspot medium=" << medium_found;
return medium_found;
}
+3 -8
View File
@@ -43,12 +43,8 @@ class HotspotCredentials {
std::string GetPassword() const { return password_; }
void SetPassword(const std::string& password) { password_ = password; }
// Gets IP Address, which is in byte sequence, in network order. For example,
// for "192.168.1.1", it'll be byte(129)+byte(168)+byte(1)+byte(1). Now only
// ipv4 is supported.
std::string GetIPAddress() const { return ip_address_; }
void SetIPAddress(const std::string& ip_address) { ip_address_ = ip_address; }
// Gets IP Address in string format.
// This is the IP address at which the service is provided.
std::string GetGateway() const { return gateway_; }
void SetGateway(const std::string& gateway) { gateway_ = gateway; }
@@ -76,8 +72,7 @@ class HotspotCredentials {
private:
std::string ssid_;
std::string password_;
std::string ip_address_;
std::string gateway_ = "0.0.0.0";
std::string gateway_;
int port_ = 0;
int frequency_ = -1;
location::nearby::proto::connections::ConnectionBand band_;
+2 -2
View File
@@ -140,7 +140,7 @@ TEST_P(WifiHotspotMediumTest, CanStartHotspotThatOtherConnect) {
WifiHotspotServerSocket server_socket = wifi_hotspot_a->ListenForService();
EXPECT_TRUE(server_socket.IsValid());
wifi_hotspot_a->GetCredential()->SetIPAddress(server_socket.GetIPAddress());
wifi_hotspot_a->GetCredential()->SetGateway(server_socket.GetIPAddress());
WifiHotspotSocket socket_a;
WifiHotspotSocket socket_b;
@@ -205,7 +205,7 @@ TEST_P(WifiHotspotMediumTest, CanStartHotspotThatOtherCanCancelConnect) {
WifiHotspotServerSocket server_socket = wifi_hotspot_a->ListenForService();
EXPECT_TRUE(server_socket.IsValid());
wifi_hotspot_a->GetCredential()->SetIPAddress(server_socket.GetIPAddress());
wifi_hotspot_a->GetCredential()->SetGateway(server_socket.GetIPAddress());
WifiHotspotSocket socket_a;
WifiHotspotSocket socket_b;