From a6f36ae8d0c73e347a13fd54200af171d6ae0794 Mon Sep 17 00:00:00 2001 From: Samiul Islam Date: Fri, 11 Feb 2022 16:17:49 +0000 Subject: [PATCH 1/2] Create root directory for supplemental data during user creation In order to store supplemental data for apps, we want to create a root directory at location `/data/misc_ce//supplmental` and `/data/misc_de/supplemental`. These directories will then host supplemental data for each app based on package name, e.g, `/data/misc_ce/0/supplemental/`. Since these are sub-directories of misc directory, vold should prepare them for consistency. Bug: 217543371 Test: atest SupplementalProcessStorageHostTest Test: see ag/16681989 Ignore-AOSP-First: Feature is being developed in internal branch Change-Id: I66ef7a7241c9f82cecedaeb6c9a91f127668300a Merged-In: I66ef7a7241c9f82cecedaeb6c9a91f127668300a (cherry picked from commit 0cf90d7ca07ea94a7a318aba6e4e8872e63337dd) --- vold_prepare_subdirs.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/vold_prepare_subdirs.cpp b/vold_prepare_subdirs.cpp index 0d58e4d..0fe8b01 100644 --- a/vold_prepare_subdirs.cpp +++ b/vold_prepare_subdirs.cpp @@ -172,8 +172,13 @@ static bool prepare_subdirs(const std::string& volume_uuid, int user_id, int fla return false; } + auto misc_de_path = android::vold::BuildDataMiscDePath(user_id); + if (!prepare_dir_for_user(sehandle, 0771, AID_SYSTEM, AID_SYSTEM, + misc_de_path + "/supplemental", user_id)) { + return false; + } + if (volume_uuid.empty()) { - auto misc_de_path = android::vold::BuildDataMiscDePath(user_id); if (!prepare_dir(sehandle, 0700, 0, 0, misc_de_path + "/vold")) return false; if (!prepare_dir(sehandle, 0700, 0, 0, misc_de_path + "/storaged")) return false; if (!prepare_dir(sehandle, 0700, 0, 0, misc_de_path + "/rollback")) return false; @@ -203,8 +208,13 @@ static bool prepare_subdirs(const std::string& volume_uuid, int user_id, int fla return false; } + auto misc_ce_path = android::vold::BuildDataMiscCePath(user_id); + if (!prepare_dir_for_user(sehandle, 0771, AID_SYSTEM, AID_SYSTEM, + misc_ce_path + "/supplemental", user_id)) { + return false; + } + if (volume_uuid.empty()) { - auto misc_ce_path = android::vold::BuildDataMiscCePath(user_id); if (!prepare_dir(sehandle, 0700, 0, 0, misc_ce_path + "/vold")) return false; if (!prepare_dir(sehandle, 0700, 0, 0, misc_ce_path + "/storaged")) return false; if (!prepare_dir(sehandle, 0700, 0, 0, misc_ce_path + "/rollback")) return false; From d302608a077fad34e186aa31e1c0b203a555ad5f Mon Sep 17 00:00:00 2001 From: Nikita Ioffe Date: Mon, 21 Feb 2022 19:03:26 +0000 Subject: [PATCH 2/2] Rename SupplementalProcess to SdkSandbox Ignore-AOSP-First: code not in AOSP yet Bug: 220320098 Test: presubmit Change-Id: I727342675f6817d4dced431b4ef57e909c02eb5a Merged-In: I727342675f6817d4dced431b4ef57e909c02eb5a (cherry picked from commit bad7cd0fd7ef149a801c165dc3ca4a3743054a6c) --- vold_prepare_subdirs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vold_prepare_subdirs.cpp b/vold_prepare_subdirs.cpp index 0fe8b01..692c500 100644 --- a/vold_prepare_subdirs.cpp +++ b/vold_prepare_subdirs.cpp @@ -174,7 +174,7 @@ static bool prepare_subdirs(const std::string& volume_uuid, int user_id, int fla auto misc_de_path = android::vold::BuildDataMiscDePath(user_id); if (!prepare_dir_for_user(sehandle, 0771, AID_SYSTEM, AID_SYSTEM, - misc_de_path + "/supplemental", user_id)) { + misc_de_path + "/sdksandbox", user_id)) { return false; } @@ -210,7 +210,7 @@ static bool prepare_subdirs(const std::string& volume_uuid, int user_id, int fla auto misc_ce_path = android::vold::BuildDataMiscCePath(user_id); if (!prepare_dir_for_user(sehandle, 0771, AID_SYSTEM, AID_SYSTEM, - misc_ce_path + "/supplemental", user_id)) { + misc_ce_path + "/sdksandbox", user_id)) { return false; }