shill: support the Cellular.Family device property.

This property is needed in order to have the UI realize that it
has a GSM modem, and should therefore enable the GSM-specific
controls.

BUG=chromium-os:28745
TEST=With list-devices, confirm that the property is set and has
the right value. In the network settings UI, bring up the "details"
panel for the cellular service, and confirm that the controls for
the correct type of modem are shown.

Change-Id: Ic2a7f7b3537004d6c92d2bd80fc54b93d277461a
Reviewed-on: https://gerrit.chromium.org/gerrit/19377
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
Commit-Ready: Eric Shienbrood <ers@chromium.org>
Tested-by: Eric Shienbrood <ers@chromium.org>
diff --git a/cellular.cc b/cellular.cc
index f3e9d37..55b9fc0 100644
--- a/cellular.cc
+++ b/cellular.cc
@@ -109,6 +109,9 @@
   PropertyStore *store = this->mutable_store();
   store->RegisterConstString(flimflam::kDBusConnectionProperty, &dbus_owner_);
   store->RegisterConstString(flimflam::kDBusObjectProperty, &dbus_path_);
+  HelpRegisterDerivedString(flimflam::kTechnologyFamilyProperty,
+                            &Cellular::GetTechnologyFamily,
+                            NULL);
   store->RegisterConstStringmap(flimflam::kHomeProviderProperty,
                                 &home_provider_.ToDict());
   // For now, only a single capability is supported.
@@ -133,11 +136,24 @@
   return StringPrintf("CellularStateUnknown-%d", state);
 }
 
+string Cellular::GetTechnologyFamily(Error *error) {
+  return capability_->GetTypeString();
+}
+
 void Cellular::SetState(State state) {
   VLOG(2) << GetStateString(state_) << " -> " << GetStateString(state);
   state_ = state;
 }
 
+void Cellular::HelpRegisterDerivedString(
+    const string &name,
+    string(Cellular::*get)(Error *),
+    void(Cellular::*set)(const string&, Error *)) {
+  mutable_store()->RegisterDerivedString(
+      name,
+      StringAccessor(new CustomAccessor<Cellular, string>(this, get, set)));
+}
+
 void Cellular::Start(Error *error,
                      const EnabledStateChangedCallback &callback) {
   VLOG(2) << __func__ << ": " << GetStateString(state_);