shill: Update properties of all interfaces when creating a Cellular device.

The CL modifies Modem::CreateDeviceFromModemProperties to update
properties of all modem interfaces (e.g. Modem, Modem.Modem3gpp, etc)
instead of the Modem interface when creating a Cellular device instance.
This ensures that the created Cellular device has the correct
registration states.

BUG=chromium-os:34882
TEST=Tested the following:
1. Build and run unit tests.
2. Run network_3GModemControl.no-autoconnect test on Gobi 3000 and
   Icera Y3400 modem.

Change-Id: I49f9d216abded5ae0baa019df81fbbebcd134f57
Reviewed-on: https://gerrit.chromium.org/gerrit/34300
Commit-Ready: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
diff --git a/modem.cc b/modem.cc
index 2b795a9..053fcdc 100644
--- a/modem.cc
+++ b/modem.cc
@@ -71,7 +71,7 @@
     // CreateDeviceFromModemProperties() and saved our initial
     // properties already
     pending_device_info_ = false;
-    CreateDeviceFromModemProperties(initial_modem_properties_);
+    CreateDeviceFromModemProperties(initial_properties_);
   }
 }
 
@@ -96,13 +96,20 @@
 }
 
 void Modem::CreateDeviceFromModemProperties(
-    const DBusPropertiesMap &modem_properties) {
+    const DBusInterfaceToProperties &properties) {
   SLOG(Modem, 2) << __func__;
 
   if (device_.get()) {
     return;
   }
-  if (!GetLinkName(modem_properties, &link_name_)) {
+
+  DBusInterfaceToProperties::const_iterator properties_it =
+      properties.find(GetModemInterface());
+  if (properties_it == properties.end()) {
+    LOG(ERROR) << "Unable to find modem interface properties.";
+    return;
+  }
+  if (!GetLinkName(properties_it->second, &link_name_)) {
     LOG(ERROR) << "Unable to create cellular device without a link name.";
     return;
   }
@@ -125,7 +132,7 @@
                                               &address_bytes)) {
     // Save our properties, wait for OnDeviceInfoAvailable to be called.
     LOG(WARNING) << "No hardware address, device creation pending device info.";
-    initial_modem_properties_ = modem_properties;
+    initial_properties_ = properties;
     pending_device_info_ = true;
     return;
   }
@@ -134,8 +141,11 @@
   device_ = ConstructCellular(link_name_, address, interface_index);
 
   // Give the device a chance to extract any capability-specific properties.
-  device_->OnDBusPropertiesChanged(GetModemInterface(), modem_properties,
-                                    vector<string>());
+  for (properties_it = properties.begin(); properties_it != properties.end();
+       ++properties_it) {
+    device_->OnDBusPropertiesChanged(
+        properties_it->first, properties_it->second, vector<string>());
+  }
 
   manager_->device_info()->RegisterDevice(device_);
 }