shill: Disconnect and disable cellular modem when stopping the device.

Also, disconnect the cellular service on Service::Disconnect. A separate patch
wires this up to powering off the device (crosbug.com/25014).

BUG=chromium-os:25116,chromium-os:25013
TEST=unit tests, tested on chromebook with disconnect-service

Change-Id: Id3b8c10fbfd917702738b8a4385d7954c03de204
Reviewed-on: https://gerrit.chromium.org/gerrit/14230
Commit-Ready: Darin Petkov <petkov@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
diff --git a/cellular.h b/cellular.h
index 42ba42a..792231c 100644
--- a/cellular.h
+++ b/cellular.h
@@ -112,6 +112,10 @@
   // failure, leaves it unchanged otherwise.
   void Connect(Error *error);
 
+  // Asynchronously disconnects the modem from the network. Populates |error| on
+  // failure, leaves it unchanged otherwise.
+  void Disconnect(Error *error);
+
   // Asynchronously activates the modem. Populates |error| on failure, leaves it
   // unchanged otherwise.
   void Activate(const std::string &carrier, Error *error);
@@ -189,6 +193,8 @@
   FRIEND_TEST(CellularServiceTest, FriendlyName);
   FRIEND_TEST(CellularTest, CreateService);
   FRIEND_TEST(CellularTest, Connect);
+  FRIEND_TEST(CellularTest, DisableModem);
+  FRIEND_TEST(CellularTest, DisconnectModem);
   FRIEND_TEST(CellularTest, GetModemInfo);
   FRIEND_TEST(CellularTest, GetModemStatus);
   FRIEND_TEST(CellularTest, InitProxies);
@@ -200,6 +206,8 @@
   void SetState(State state);
 
   void ConnectTask(const DBusPropertiesMap &properties);
+  void DisconnectTask();
+  void DisconnectModem();
 
   // Invoked when the modem is connected to the cellular network to transition
   // to the network-connected state and bring the network interface up.
@@ -209,6 +217,7 @@
   void InitProxies();
 
   void EnableModem();
+  void DisableModem();
   void GetModemStatus();
 
   // Obtains modem's manufacturer, model ID, and hardware revision.