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/property_store.cc b/property_store.cc
index 9b8757b..ee75f1f 100644
--- a/property_store.cc
+++ b/property_store.cc
@@ -29,10 +29,11 @@
   return (bool_properties_.find(prop) != bool_properties_.end() ||
           int16_properties_.find(prop) != int16_properties_.end() ||
           int32_properties_.find(prop) != int32_properties_.end() ||
+          (key_value_store_properties_.find(prop) !=
+           key_value_store_properties_.end()) ||
           string_properties_.find(prop) != string_properties_.end() ||
           stringmap_properties_.find(prop) != stringmap_properties_.end() ||
           stringmaps_properties_.find(prop) != stringmaps_properties_.end() ||
-          strintpair_properties_.find(prop) != strintpair_properties_.end() ||
           strings_properties_.find(prop) != strings_properties_.end() ||
           uint8_properties_.find(prop) != uint8_properties_.end() ||
           uint16_properties_.find(prop) != uint16_properties_.end() ||
@@ -110,6 +111,12 @@
   return ReadablePropertyConstIterator<int32>(int32_properties_);
 }
 
+ReadablePropertyConstIterator<KeyValueStore>
+PropertyStore::GetKeyValueStorePropertiesIter() const {
+  return
+      ReadablePropertyConstIterator<KeyValueStore>(key_value_store_properties_);
+}
+
 ReadablePropertyConstIterator<std::string>
 PropertyStore::GetStringPropertiesIter() const {
   return ReadablePropertyConstIterator<std::string>(string_properties_);
@@ -131,11 +138,6 @@
   return ReadablePropertyConstIterator<Strings>(strings_properties_);
 }
 
-ReadablePropertyConstIterator<StrIntPair>
-PropertyStore::GetStrIntPairPropertiesIter() const {
-  return ReadablePropertyConstIterator<StrIntPair>(strintpair_properties_);
-}
-
 ReadablePropertyConstIterator<uint8> PropertyStore::GetUint8PropertiesIter()
     const {
   return ReadablePropertyConstIterator<uint8>(uint8_properties_);
@@ -296,6 +298,12 @@
   int32_properties_[name] = accessor;
 }
 
+void PropertyStore::RegisterDerivedKeyValueStore(
+    const std::string &name,
+    const KeyValueStoreAccessor &acc) {
+  key_value_store_properties_[name] = acc;
+}
+
 void PropertyStore::RegisterDerivedString(const std::string &name,
                                           const StringAccessor &accessor) {
   string_properties_[name] = accessor;
@@ -311,11 +319,6 @@
   stringmaps_properties_[name] = acc;
 }
 
-void PropertyStore::RegisterDerivedStrIntPair(const std::string &name,
-                                              const StrIntPairAccessor &acc) {
-  strintpair_properties_[name] = acc;
-}
-
 void PropertyStore::RegisterDerivedUint16(const std::string &name,
                                           const Uint16Accessor &acc) {
   uint16_properties_[name] = acc;