shill: Add CellularCapabilityUniversal

Add the CellularCapabilityUniversal class so that shill can talk to a
ModemManager1 DBUS interface.  Ensure that a modems can be created
with either the new or the old modem manager running.

Register to receive DBus property changes from ModemManager1

BUG=chromium-os:28596, chromium-os:26650
TEST=Run unit tests, test that modem is created with Y3300

Change-Id: I8717318e944589bc85e763bd7234336559256dbc
Reviewed-on: https://gerrit.chromium.org/gerrit/19888
Commit-Ready: Jason Glasgow <jglasgow@chromium.org>
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
Tested-by: Jason Glasgow <jglasgow@chromium.org>
diff --git a/cellular.cc b/cellular.cc
index d7058e6..34a4c3f 100644
--- a/cellular.cc
+++ b/cellular.cc
@@ -15,12 +15,12 @@
 #include <base/logging.h>
 #include <base/stringprintf.h>
 #include <chromeos/dbus/service_constants.h>
-#include <mm/mm-modem.h>
 #include <mobile_provider.h>
 
 #include "shill/adaptor_interfaces.h"
 #include "shill/cellular_capability_cdma.h"
 #include "shill/cellular_capability_gsm.h"
+#include "shill/cellular_capability_universal.h"
 #include "shill/cellular_service.h"
 #include "shill/control_interface.h"
 #include "shill/device.h"
@@ -35,8 +35,6 @@
 #include "shill/technology.h"
 
 using base::Bind;
-using base::Closure;
-using std::map;
 using std::string;
 using std::vector;
 
@@ -210,13 +208,13 @@
       capability_.reset(new CellularCapabilityCDMA(this, proxy_factory));
       break;
     case kTypeUniversal:
-      LOG(ERROR) << "Cannot InitCapability on MM1 modem";
+      capability_.reset(new CellularCapabilityUniversal(this, proxy_factory));
       break;
     default: NOTREACHED();
   }
 }
 
-void Cellular::Activate(const std::string &carrier,
+void Cellular::Activate(const string &carrier,
                         Error *error, const ResultCallback &callback) {
   capability_->Activate(carrier, error, callback);
 }
@@ -327,7 +325,7 @@
   }
   CHECK_EQ(kStateRegistered, state_);
 
-  if (!capability_->allow_roaming() &&
+  if (!capability_->AllowRoaming() &&
       service_->roaming_state() == flimflam::kRoamingStateRoaming) {
     Error::PopulateAndLog(error, Error::kNotOnHomeNetwork,
                           "Roaming disallowed; connection request ignored.");
@@ -344,7 +342,7 @@
 void Cellular::OnConnected() {
   VLOG(2) << __func__;
   SetState(kStateConnected);
-  if (!capability_->allow_roaming() &&
+  if (!capability_->AllowRoaming() &&
       service_->roaming_state() == flimflam::kRoamingStateRoaming) {
     Disconnect(NULL);
   } else {
@@ -413,6 +411,15 @@
   }
 }
 
+void Cellular::OnDBusPropertiesChanged(
+    const string &interface,
+    const DBusPropertiesMap &changed_properties,
+    const vector<string> &invalidated_properties) {
+  capability_->OnDBusPropertiesChanged(interface,
+                                       changed_properties,
+                                       invalidated_properties);
+}
+
 void Cellular::OnModemManagerPropertiesChanged(
     const DBusPropertiesMap &properties) {
   capability_->OnModemManagerPropertiesChanged(properties);