Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: chromeos/network/device_state.cc

Issue 14137017: Add TechnologyState to NetworkStateHandler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chromeos/network/device_state.cc
diff --git a/chromeos/network/device_state.cc b/chromeos/network/device_state.cc
index 78a8674ca470de17aa301651cbaf57be525db005..61f14d882ec5ecc67ba56d633c5354e054e1ac58 100644
--- a/chromeos/network/device_state.cc
+++ b/chromeos/network/device_state.cc
@@ -15,7 +15,8 @@ DeviceState::DeviceState(const std::string& path)
: ManagedState(MANAGED_TYPE_DEVICE, path),
provider_requires_roaming_(false),
support_network_scan_(false),
- scanning_(false) {
+ scanning_(false),
+ sim_present_(true) {
}
DeviceState::~DeviceState() {
@@ -56,8 +57,25 @@ bool DeviceState::PropertyChanged(const std::string& key,
<< home_provider_id_;
}
return true;
+ } else if (key == flimflam::kTechnologyFamilyProperty) {
+ return GetStringValue(key, value, &technology_family_);
+ } else if (key == flimflam::kSIMLockStatusProperty) {
+ const DictionaryValue* dict = NULL;
+ if (!value.GetAsDictionary(&dict))
+ return false;
+ if (!dict->GetStringWithoutPathExpansion(flimflam::kSIMLockTypeProperty,
+ &sim_lock_type_))
+ return false;
+ // Ignore other SIMLockStatus properties.
+ return true;
+ } else if (key == shill::kSIMPresentProperty) {
+ return GetBooleanValue(key, value, &sim_present_);
}
return false;
}
+bool DeviceState::IsSimAbsent() const {
+ return technology_family_ == flimflam::kTechnologyFamilyGsm && !sim_present_;
+}
+
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698