shill: wimax: Refactor service management out of WiMax into WiMaxProvider.

This allows WiMAX service management to be independent from the
availability of WiMAX devices.

BUG=chrome-os-partner:9907
TEST=unit tests

Change-Id: I52ad31ed8ef1d271b04bbd2cfc17729a5c112831
Reviewed-on: https://gerrit.chromium.org/gerrit/23511
Commit-Ready: Darin Petkov <petkov@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
diff --git a/wimax_service.h b/wimax_service.h
index 582f2dd..c48c0a5 100644
--- a/wimax_service.h
+++ b/wimax_service.h
@@ -25,8 +25,7 @@
   WiMaxService(ControlInterface *control,
                EventDispatcher *dispatcher,
                Metrics *metrics,
-               Manager *manager,
-               const WiMaxRefPtr &wimax);
+               Manager *manager);
   virtual ~WiMaxService();
 
   // Returns the parameters to be passed to WiMaxManager.Device.Connect() when
@@ -44,7 +43,8 @@
   virtual bool Start(WiMaxNetworkProxyInterface *proxy);
 
   // Stops the service by disassociating it from |proxy_| and resetting its
-  // signal strength to 0.
+  // signal strength to 0. If the service is connected, it notifies the carrier
+  // device that the service is stopped.
   virtual void Stop();
 
   virtual bool IsStarted() const;
@@ -70,7 +70,10 @@
   virtual void set_eap(const EapCredentials &eap);
   virtual bool Save(StoreInterface *storage);
 
+  // TODO(petkov): Support Unload (crosbug.com/p/9942).
+
  private:
+  friend class WiMaxServiceTest;
   FRIEND_TEST(WiMaxServiceTest, GetDeviceRpcId);
   FRIEND_TEST(WiMaxServiceTest, OnSignalStrengthChanged);
   FRIEND_TEST(WiMaxServiceTest, SetEAP);
@@ -82,7 +85,7 @@
 
   void UpdateConnectable();
 
-  WiMaxRefPtr wimax_;
+  WiMaxRefPtr device_;
   scoped_ptr<WiMaxNetworkProxyInterface> proxy_;
   std::string storage_id_;