Index: chromeos/network/network_state.cc |
diff --git a/chromeos/network/network_state.cc b/chromeos/network/network_state.cc |
index f473fcdadcd74a01e4d0e78d0d5e0ede38e65b2e..db00b7d725e9f7db0b6b3a7f67abe1886959d569 100644 |
--- a/chromeos/network/network_state.cc |
+++ b/chromeos/network/network_state.cc |
@@ -130,12 +130,22 @@ bool NetworkState::InitialPropertiesReceived( |
if (!properties.HasKey(shill::kTypeProperty)) { |
NET_LOG_ERROR("NetworkState has no type", |
shill_property_util::GetNetworkIdFromProperties(properties)); |
- } else { |
- changed |= UpdateName(properties); |
+ return false; |
} |
+ // Ensure that the network has a valid name. |
+ changed |= UpdateName(properties); |
+ |
+ // Set the ca_cert_nss_ property. |
bool had_ca_cert_nss = has_ca_cert_nss_; |
has_ca_cert_nss_ = IsCaCertNssSet(properties); |
changed |= had_ca_cert_nss != has_ca_cert_nss_; |
+ |
+ // By convention, all visible WiFi networks have a SignalStrength > 0. |
pneubeck (no reviews)
2014/05/08 13:25:12
unrelated?
stevenjb
2014/05/08 22:32:26
Yeah, I guess it is. I added this while working on
|
+ if (type() == shill::kTypeWifi) { |
+ if (signal_strength_ <= 0) |
+ signal_strength_ = 1; |
+ } |
+ |
return changed; |
} |
@@ -252,6 +262,10 @@ std::string NetworkState::GetNetmask() const { |
return network_util::PrefixLengthToNetmask(prefix_length_); |
} |
+void NetworkState::SetGuid(const std::string& guid) { |
+ guid_ = guid; |
+} |
+ |
bool NetworkState::UpdateName(const base::DictionaryValue& properties) { |
std::string updated_name = |
shill_property_util::GetNameFromProperties(path(), properties); |