shill: Manager: Create "DefaultService" property
This property contains the object path of the default service.
The Manager will emit a PropertyChanged signal when this value
changes from its previous value.
CQ-DEPENDS=I5b85c6ae3960ecfe9067f05c3527f27109edd8c3
BUG=chromium-os:33395
TEST=Modified unit tests + manual (since the mock Emit* functions
are hard to get to): Use dbus-monitor to display property change
messages. Read manager DBus properties to make sure DefaultService
is "/" at startup and when not connected.
Change-Id: I7f980dcd1a311af58dd396bf76326711f414e27c
Reviewed-on: https://gerrit.chromium.org/gerrit/29693
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
diff --git a/manager.h b/manager.h
index e0abdeb..b33fd49 100644
--- a/manager.h
+++ b/manager.h
@@ -278,8 +278,10 @@
RpcIdentifiers EnumerateWatchedServices(Error *error);
std::string GetActiveProfileRpcIdentifier(Error *error);
std::string GetCheckPortalList(Error *error);
+ RpcIdentifier GetDefaultServiceRpcIdentifier(Error *error);
ServiceRefPtr GetServiceInner(const KeyValueStore &args, Error *error);
void SetCheckPortalList(const std::string &portal_list, Error *error);
+ void EmitDefaultService();
void EmitDeviceProperties();
// Unload a service while iterating through |services_|. Returns true if
@@ -288,6 +290,9 @@
// increment |service_iterator|).
bool UnloadService(std::vector<ServiceRefPtr>::iterator *service_iterator);
+ void HelpRegisterConstDerivedRpcIdentifier(
+ const std::string &name,
+ RpcIdentifier(Manager::*get)(Error *));
void HelpRegisterConstDerivedRpcIdentifiers(
const std::string &name,
RpcIdentifiers(Manager::*get)(Error *));
@@ -348,6 +353,10 @@
// The priority order of technologies
std::vector<Technology::Identifier> technology_order_;
+ // This is the last Service RPC Identifier for which we emitted a
+ // "DefaultService" signal for.
+ RpcIdentifier default_service_rpc_identifier_;
+
// Manager can be optionally configured with a list of technologies to
// do portal detection on at startup. We need to keep track of that list
// as well as a flag that tells us whether we should continue using it