| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chromeos/network/device_state.h" | 5 #include "chromeos/network/device_state.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "third_party/cros_system_api/dbus/service_constants.h" | 10 #include "third_party/cros_system_api/dbus/service_constants.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 return GetStringValue(key, value, &technology_family_); | 61 return GetStringValue(key, value, &technology_family_); |
| 62 } else if (key == flimflam::kSIMLockStatusProperty) { | 62 } else if (key == flimflam::kSIMLockStatusProperty) { |
| 63 const DictionaryValue* dict = NULL; | 63 const DictionaryValue* dict = NULL; |
| 64 if (!value.GetAsDictionary(&dict)) | 64 if (!value.GetAsDictionary(&dict)) |
| 65 return false; | 65 return false; |
| 66 if (!dict->GetStringWithoutPathExpansion(flimflam::kSIMLockTypeProperty, | 66 if (!dict->GetStringWithoutPathExpansion(flimflam::kSIMLockTypeProperty, |
| 67 &sim_lock_type_)) | 67 &sim_lock_type_)) |
| 68 return false; | 68 return false; |
| 69 // Ignore other SIMLockStatus properties. | 69 // Ignore other SIMLockStatus properties. |
| 70 return true; | 70 return true; |
| 71 } else if (key == flimflam::kMeidProperty) { |
| 72 return GetStringValue(key, value, &meid_); |
| 73 } else if (key == flimflam::kImeiProperty) { |
| 74 return GetStringValue(key, value, &imei_); |
| 75 } else if (key == flimflam::kIccidProperty) { |
| 76 return GetStringValue(key, value, &iccid_); |
| 77 } else if (key == flimflam::kMdnProperty) { |
| 78 return GetStringValue(key, value, &mdn_); |
| 71 } else if (key == shill::kSIMPresentProperty) { | 79 } else if (key == shill::kSIMPresentProperty) { |
| 72 return GetBooleanValue(key, value, &sim_present_); | 80 return GetBooleanValue(key, value, &sim_present_); |
| 73 } | 81 } |
| 74 return false; | 82 return false; |
| 75 } | 83 } |
| 76 | 84 |
| 77 bool DeviceState::IsSimAbsent() const { | 85 bool DeviceState::IsSimAbsent() const { |
| 78 return technology_family_ == flimflam::kTechnologyFamilyGsm && !sim_present_; | 86 return technology_family_ == flimflam::kTechnologyFamilyGsm && !sim_present_; |
| 79 } | 87 } |
| 80 | 88 |
| 81 } // namespace chromeos | 89 } // namespace chromeos |
| OLD | NEW |