summaryrefslogtreecommitdiff
path: root/cmds/installd/utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cmds/installd/utils.cpp')
-rw-r--r--cmds/installd/utils.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/cmds/installd/utils.cpp b/cmds/installd/utils.cpp
index e58391fb04..e586caa681 100644
--- a/cmds/installd/utils.cpp
+++ b/cmds/installd/utils.cpp
@@ -64,6 +64,15 @@ std::string create_data_user_package_path(const char* volume_uuid,
create_data_user_path(volume_uuid, user).c_str(), package_name);
}
+std::string create_data_user_de_package_path(const char* volume_uuid,
+ userid_t user, const char* package_name) {
+ CHECK(is_valid_filename(package_name));
+ CHECK(is_valid_package_name(package_name) == 0);
+
+ return StringPrintf("%s/%s",
+ create_data_user_de_path(volume_uuid, user).c_str(), package_name);
+}
+
int create_pkg_path(char path[PKG_PATH_MAX], const char *pkgname,
const char *postfix, userid_t userid) {
if (is_valid_package_name(pkgname) != 0) {
@@ -115,6 +124,14 @@ std::string create_data_user_path(const char* volume_uuid, userid_t userid) {
}
/**
+ * Create the path name for device encrypted user data for a certain userid.
+ */
+std::string create_data_user_de_path(const char* volume_uuid, userid_t userid) {
+ std::string data(create_data_path(volume_uuid));
+ return StringPrintf("%s/user_de/%u", data.c_str(), userid);
+}
+
+/**
* Create the path name for media for a certain userid.
*/
std::string create_data_media_path(const char* volume_uuid, userid_t userid) {