shill: Add SIMLockEnabled to the SIM lock status properties and emit changes.

This patch replaces the StrIntPair class with the more generic KeyValueStore and
updates cellular's SIMLockStatus property to include the enabled key/value pair.

BUG=chromium-os:25850
TEST=unit tests

Change-Id: I2662cb468807e3afa04c3699e323f31282e1a50e
Reviewed-on: https://gerrit.chromium.org/gerrit/15325
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Eric Shienbrood <ers@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Darin Petkov <petkov@chromium.org>
diff --git a/cellular_capability_gsm.h b/cellular_capability_gsm.h
index d19738d..d1eac54 100644
--- a/cellular_capability_gsm.h
+++ b/cellular_capability_gsm.h
@@ -23,9 +23,6 @@
                               public ModemGSMCardProxyDelegate,
                               public ModemGSMNetworkProxyDelegate {
  public:
-  static const char kPropertyUnlockRequired[];
-  static const char kPropertyUnlockRetries[];
-
   CellularCapabilityGSM(Cellular *cellular, ProxyFactory *proxy_factory);
 
   // Inherited from CellularCapability.
@@ -61,15 +58,11 @@
   virtual void OnModemManagerPropertiesChanged(
       const DBusPropertiesMap &properties);
 
-  const std::string &spn() const { return spn_; }
-  const std::string &sim_lock_type() const {
-    return sim_lock_status_.lock_type;
-  }
-  uint32 sim_lock_retries_left() const { return sim_lock_status_.retries_left; }
-
  private:
   friend class CellularTest;
   friend class CellularCapabilityGSMTest;
+  FRIEND_TEST(CellularTest, StartGSMRegister);
+  FRIEND_TEST(CellularCapabilityGSMTest, CreateDeviceFromProperties);
   FRIEND_TEST(CellularCapabilityGSMTest, CreateFriendlyServiceName);
   FRIEND_TEST(CellularCapabilityGSMTest, GetIMEI);
   FRIEND_TEST(CellularCapabilityGSMTest, GetIMSI);
@@ -88,14 +81,14 @@
   FRIEND_TEST(CellularCapabilityGSMTest, SetHomeProvider);
   FRIEND_TEST(CellularCapabilityGSMTest, UpdateOperatorInfo);
   FRIEND_TEST(CellularCapabilityGSMTest, GetRegistrationState);
+  FRIEND_TEST(CellularCapabilityGSMTest, OnModemManagerPropertiesChanged);
+  FRIEND_TEST(ModemTest, CreateDeviceFromProperties);
 
   struct SimLockStatus {
    public:
-    SimLockStatus() : retries_left(0) {}
-    SimLockStatus(const std::string &in_lock_type, uint32 in_retries_left)
-        : lock_type(in_lock_type),
-          retries_left(in_retries_left) {}
+    SimLockStatus() : enabled(false), retries_left(0) {}
 
+    bool enabled;
     std::string lock_type;
     uint32 retries_left;
   };
@@ -107,6 +100,10 @@
   static const char kNetworkPropertyStatus[];
   static const char kPhoneNumber[];
   static const char kPropertyAccessTechnology[];
+  static const char kPropertyEnabledFacilityLocks[];
+  static const char kPropertyUnlockRequired[];
+  static const char kPropertyUnlockRetries[];
+
 
   void SetAccessTechnology(uint32 access_technology);
 
@@ -126,12 +123,13 @@
 
   Stringmap ParseScanResult(const GSMScanResult &result);
 
-  StrIntPair SimLockStatusToProperty(Error *error);
+  KeyValueStore SimLockStatusToProperty(Error *error);
 
-  void HelpRegisterDerivedStrIntPair(
+  void HelpRegisterDerivedKeyValueStore(
       const std::string &name,
-      StrIntPair(CellularCapabilityGSM::*get)(Error *),
-      void(CellularCapabilityGSM::*set)(const StrIntPair&, Error *));
+      KeyValueStore(CellularCapabilityGSM::*get)(Error *error),
+      void(CellularCapabilityGSM::*set)(
+          const KeyValueStore &value, Error *error));
 
   // Signal callbacks inherited from ModemGSMNetworkProxyDelegate.
   virtual void OnGSMNetworkModeChanged(uint32 mode);