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 #ifndef CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ |
6 #define CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 const std::string& esn() const { return esn_; } | 113 const std::string& esn() const { return esn_; } |
114 const std::string& mdn() const { return mdn_; } | 114 const std::string& mdn() const { return mdn_; } |
115 const std::string& min() const { return min_; } | 115 const std::string& min() const { return min_; } |
116 const std::string& model_id() const { return model_id_; } | 116 const std::string& model_id() const { return model_id_; } |
117 const std::string& manufacturer() const { return manufacturer_; } | 117 const std::string& manufacturer() const { return manufacturer_; } |
118 SimLockState sim_lock_state() const { return sim_lock_state_; } | 118 SimLockState sim_lock_state() const { return sim_lock_state_; } |
119 bool is_sim_locked() const { | 119 bool is_sim_locked() const { |
120 return sim_lock_state_ == SIM_LOCKED_PIN || | 120 return sim_lock_state_ == SIM_LOCKED_PIN || |
121 sim_lock_state_ == SIM_LOCKED_PUK; | 121 sim_lock_state_ == SIM_LOCKED_PUK; |
122 } | 122 } |
| 123 // Returns true if GSM modem and SIM as absent, otherwise |
| 124 // returns false: GSM modem and SIM card is present or CDMA modem. |
| 125 bool is_sim_absent() const { |
| 126 return technology_family() == TECHNOLOGY_FAMILY_GSM && |
| 127 !is_sim_locked() && imsi().empty(); |
| 128 } |
123 const int sim_retries_left() const { return sim_retries_left_; } | 129 const int sim_retries_left() const { return sim_retries_left_; } |
124 SimPinRequire sim_pin_required() const { return sim_pin_required_; } | 130 SimPinRequire sim_pin_required() const { return sim_pin_required_; } |
125 const std::string& firmware_revision() const { return firmware_revision_; } | 131 const std::string& firmware_revision() const { return firmware_revision_; } |
126 const std::string& hardware_revision() const { return hardware_revision_; } | 132 const std::string& hardware_revision() const { return hardware_revision_; } |
127 const unsigned int prl_version() const { return prl_version_; } | 133 const unsigned int prl_version() const { return prl_version_; } |
128 const std::string& home_provider_code() const { return home_provider_code_; } | 134 const std::string& home_provider_code() const { return home_provider_code_; } |
129 const std::string& home_provider_country() const { | 135 const std::string& home_provider_country() const { |
130 return home_provider_country_; | 136 return home_provider_country_; |
131 } | 137 } |
132 const std::string& home_provider_id() const { return home_provider_id_; } | 138 const std::string& home_provider_id() const { return home_provider_id_; } |
(...skipping 1514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1647 const std::string& service_path) = 0; | 1653 const std::string& service_path) = 0; |
1648 | 1654 |
1649 // Factory function, creates a new instance and returns ownership. | 1655 // Factory function, creates a new instance and returns ownership. |
1650 // For normal usage, access the singleton via CrosLibrary::Get(). | 1656 // For normal usage, access the singleton via CrosLibrary::Get(). |
1651 static NetworkLibrary* GetImpl(bool stub); | 1657 static NetworkLibrary* GetImpl(bool stub); |
1652 }; | 1658 }; |
1653 | 1659 |
1654 } // namespace chromeos | 1660 } // namespace chromeos |
1655 | 1661 |
1656 #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ | 1662 #endif // CHROME_BROWSER_CHROMEOS_CROS_NETWORK_LIBRARY_H_ |
OLD | NEW |