shill: vpn: Auto-connect at most one service at a time, only when online.

This patch suppresses auto-connect for non-primary technologies (such
as VPN) while the system is offline. Also, don't auto-connect a VPN
service if there's already an active (connecting or connected) VPN
service.

Cleanup Manager's online/offline API a bit.

BUG=chromium-os:38229
TEST=unit tests

Change-Id: Iedd3879cf45c8b509a956415c7de5e5ba1af4652
Reviewed-on: https://gerrit.chromium.org/gerrit/42226
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Darin Petkov <petkov@chromium.org>
diff --git a/vpn_service.h b/vpn_service.h
index 4a6bc9b..4fc46f2 100644
--- a/vpn_service.h
+++ b/vpn_service.h
@@ -48,11 +48,12 @@
   virtual bool IsAutoConnectable(const char **reason) const;
 
  private:
+  friend class VPNServiceTest;
   FRIEND_TEST(VPNServiceTest, GetDeviceRpcId);
-  FRIEND_TEST(VPNServiceTest, IsAutoConnectable);
   FRIEND_TEST(VPNServiceTest, SetConnection);
 
   static const char kAutoConnNeverConnected[];
+  static const char kAutoConnVPNAlreadyActive[];
 
   virtual std::string GetDeviceRpcId(Error *error);