shill: cellular: Suppress auto-connect when device is not running.

When a cellular device is being disabled, it may disconnect a
connected cellular service. However, shill may try to auto-connect the
service before the service is destroyed. To avoid such a race, this CL
makes a cellular service not auto-connectable when the cellular device
is not running.

BUG=chromium-os:34182
TEST=Tested the following:
1. Build and run unit tests.
2. After connecting to a cellular network, disable the cellular
   technology and verify that shill does not try to auto-connect the
   cellular service while the cellular device is being disabled.

Change-Id: I4ce18dfc416984c607976a183100779b645ebbcb
Reviewed-on: https://gerrit.chromium.org/gerrit/34497
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>
diff --git a/service.h b/service.h
index ca8441a..16d1c3c 100644
--- a/service.h
+++ b/service.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef SHILL_SERVICE_
-#define SHILL_SERVICE_
+#ifndef SHILL_SERVICE_H_
+#define SHILL_SERVICE_H_
 
 #include <time.h>
 
@@ -505,6 +505,7 @@
   friend class WiFiServiceTest;
   friend class WiMaxServiceTest;
   FRIEND_TEST(AllMockServiceTest, AutoConnectWithFailures);
+  FRIEND_TEST(CellularServiceTest, IsAutoConnectable);
   FRIEND_TEST(DeviceTest, IPConfigUpdatedFailureWithStatic);
   FRIEND_TEST(ServiceTest, CalculateState);
   FRIEND_TEST(ServiceTest, CalculateTechnology);
@@ -633,4 +634,4 @@
 
 }  // namespace shill
 
-#endif  // SHILL_SERVICE_
+#endif  // SHILL_SERVICE_H_