PM: ShillProvider now provides the connection tethering mode.
This adds a connection tethering variable to the RealShillProvider. In
doing so, we:
* Query the default service attributes (type, tethering) eagerly, as
soon as a default service signal is received (but only if the default
service has actually changed).
* All variables are reduced to CopyVariable instances, migrating all
DBus communication logic into the RealShillProvider and eliminating
the ShillConnector helper class. This also allows us to turn variables
into contained members and initialize them during construction.
BUG=chromium:355732
TEST=Unit tests.
Change-Id: I8d9798075a4bd5b9e2cec65cb437d0018654d2c6
Reviewed-on: https://chromium-review.googlesource.com/193927
Tested-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
diff --git a/policy_manager/shill_provider.h b/policy_manager/shill_provider.h
index 7b87903..b53266f 100644
--- a/policy_manager/shill_provider.h
+++ b/policy_manager/shill_provider.h
@@ -22,17 +22,29 @@
kUnknown
};
+enum class ConnectionTethering {
+ kNotDetected,
+ kSuspected,
+ kConfirmed,
+ kUnknown,
+};
+
// Provider for networking related information.
class ShillProvider : public Provider {
public:
- // Returns whether we currently have network connectivity.
+ // A variable returning whether we currently have network connectivity.
virtual Variable<bool>* var_is_connected() = 0;
- // Returns the current network connection type. Unknown if not connected.
+ // A variable returning the current network connection type. Unknown if not
+ // connected.
virtual Variable<ConnectionType>* var_conn_type() = 0;
- // Returns the time when network connection last changed; initialized to
- // current time.
+ // A variable returning the tethering mode of a network connection. Unknown if
+ // not connected.
+ virtual Variable<ConnectionTethering>* var_conn_tethering() = 0;
+
+ // A variable retruning the time when network connection last changed.
+ // Initialized to current time.
virtual Variable<base::Time>* var_conn_last_changed() = 0;
protected: