PM: Add a shill provider skeleton.

This introduces an initial implementation of a shill provider. None of
the backend works, of course; for now, this includes the following:

* Three variables used for obtaining the connectivity status, current
  connection type and the last time the connection has changed. This
  should suffice for computing current policy-related decisions, such as
  whether/when to update depending on the connection type.  However, as
  I'm not entirely sure how to track the last-changed time, it might
  change as the implementation ramps up. The variables are currently
  initialized to a deterministic default.

* Unit tests for the existing (very minimal) functionality.

BUG=None
TEST=Builds and passes unit tests.

Change-Id: Ib4fcefb6bcbed43cd3ba7615de5eaad996fb7fb3
Reviewed-on: https://chromium-review.googlesource.com/184491
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
diff --git a/policy_manager/shill_provider.h b/policy_manager/shill_provider.h
new file mode 100644
index 0000000..4b56583
--- /dev/null
+++ b/policy_manager/shill_provider.h
@@ -0,0 +1,60 @@
+// Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_SHILL_PROVIDER_H
+#define CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_SHILL_PROVIDER_H
+
+#include <base/memory/scoped_ptr.h>
+#include <base/time.h>
+
+#include "update_engine/policy_manager/provider.h"
+#include "update_engine/policy_manager/variable.h"
+
+using base::Time;
+
+namespace chromeos_policy_manager {
+
+// TODO(garnold) Adapted from connection_manager.h.
+enum ShillConnType {
+  kShillConnTypeEthernet = 0,
+  kShillConnTypeWifi,
+  kShillConnTypeWimax,
+  kShillConnTypeBluetooth,
+  kShillConnTypeCellular,
+  kShillConnTypeUnknown
+};
+
+// Provider for networking related information.
+class ShillProvider : public Provider {
+ public:
+  // Returns whether we currently have network connectivity.
+  Variable<bool>* var_is_connected() const {
+    return var_is_connected_.get();
+  }
+
+  // Returns the current network connection type. Unknown if not connected.
+  Variable<ShillConnType>* var_conn_type() const {
+    return var_conn_type_.get();
+  }
+
+  // Returns the time when network connection last changed; initialized to
+  // current time.
+  Variable<base::Time>* var_conn_last_changed() const {
+    return var_conn_last_changed_.get();
+  }
+
+ protected:
+  ShillProvider() {}
+
+  scoped_ptr<Variable<bool> > var_is_connected_;
+  scoped_ptr<Variable<ShillConnType> > var_conn_type_;
+  scoped_ptr<Variable<base::Time> > var_conn_last_changed_;
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(ShillProvider);
+};
+
+}  // namespace chromeos_policy_manager
+
+#endif  // CHROMEOS_PLATFORM_UPDATE_ENGINE_POLICY_MANAGER_SHILL_PROVIDER_H