Consistent creation/destruction of user data.
Preparing and destroying users currently needs to be split across
installd, system_server, and vold, since no single party has all the
required SELinux permissions.
Bug: 27896918, 25861755
Change-Id: Ieec14ccacfc7a3a5ab00df47ace7318feb900c38
diff --git a/Utils.cpp b/Utils.cpp
index 9d5f168..7ae22c5 100644
--- a/Utils.cpp
+++ b/Utils.cpp
@@ -560,6 +560,10 @@
return StringPrintf("%s/expand_%s.key", kKeyPath, partGuid.c_str());
}
+std::string BuildDataSystemLegacyPath(userid_t userId) {
+ return StringPrintf("%s/system/users/%u", BuildDataPath(nullptr).c_str(), userId);
+}
+
std::string BuildDataSystemCePath(userid_t userId) {
return StringPrintf("%s/system_ce/%u", BuildDataPath(nullptr).c_str(), userId);
}
@@ -568,6 +572,10 @@
return StringPrintf("%s/system_de/%u", BuildDataPath(nullptr).c_str(), userId);
}
+std::string BuildDataMiscLegacyPath(userid_t userId) {
+ return StringPrintf("%s/misc/user/%u", BuildDataPath(nullptr).c_str(), userId);
+}
+
std::string BuildDataMiscCePath(userid_t userId) {
return StringPrintf("%s/misc_ce/%u", BuildDataPath(nullptr).c_str(), userId);
}
@@ -596,13 +604,13 @@
}
}
-std::string BuildDataMediaPath(const char* volumeUuid, userid_t userId) {
+std::string BuildDataMediaCePath(const char* volumeUuid, userid_t userId) {
// TODO: unify with installd path generation logic
std::string data(BuildDataPath(volumeUuid));
return StringPrintf("%s/media/%u", data.c_str(), userId);
}
-std::string BuildDataUserPath(const char* volumeUuid, userid_t userId) {
+std::string BuildDataUserCePath(const char* volumeUuid, userid_t userId) {
// TODO: unify with installd path generation logic
std::string data(BuildDataPath(volumeUuid));
if (volumeUuid == nullptr) {