shill: Profile: Add "UserHash" property
Add a read-only property to the Profile that contains an opaque
"UserHash" string. This string is populated using a new field
in the Profile::Identifier structure, which can be filled in as
it is being created by by using a new Manager::InsertUserProfile
RPC call. InsertUserProfile is so named because it's still not
completely resolved in the design where in the profile stack a
profile inserted via this method will end up (See design doc
https://go/cros-multiprofile for up-to-date discussion).
CQ-DEPEND=CL:48378
BUG=chromium:231858
TEST=Unit tests
Change-Id: I0c6623f3d7253eb4d773712cddb72a222c0be6c5
Reviewed-on: https://gerrit.chromium.org/gerrit/48405
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
diff --git a/manager.h b/manager.h
index 321dc1c..e832b4b 100644
--- a/manager.h
+++ b/manager.h
@@ -27,6 +27,7 @@
#include "shill/metrics.h"
#include "shill/modem_info.h"
#include "shill/power_manager.h"
+#include "shill/profile.h"
#include "shill/property_store.h"
#include "shill/service.h"
#include "shill/wifi.h"
@@ -156,6 +157,13 @@
// Pushes existing profile with name |name| onto stack of managed profiles.
// Returns the RPC path of the pushed profile in |path|.
void PushProfile(const std::string &name, std::string *path, Error *error);
+ // Insert an existing user profile with name |name| into the stack of
+ // managed profiles. Associate |user_hash| with this profile entry.
+ // Returns the RPC path of the pushed profile in |path|.
+ void InsertUserProfile(const std::string &name,
+ const std::string &user_hash,
+ std::string *path,
+ Error *error);
// Pops profile named |name| off the top of the stack of managed profiles.
void PopProfile(const std::string &name, Error *error);
// Remove the active profile.
@@ -432,6 +440,10 @@
Strings(Manager::*get)(Error *),
void(Manager::*set)(const Strings&, Error *));
+ bool HasProfile(const Profile::Identifier &ident);
+ void PushProfileInternal(const Profile::Identifier &ident,
+ std::string *path,
+ Error *error);
void PopProfileInternal();
void SortServices();
void SortServicesTask();