Create directories for snapshots of DE_n and CE_n apex data.

This creates apexrollback directories under /data/misc_[de|ce]/<user>
which will hold snapshots of DE_n and CE_n apex data directories
(i.e. it will hold backups of data from /data/misc_[de|ce]/<user>/apexdata
for particular apexes).

See go/apex-data-directories for details.

Bug: 141148175
Test: Built and flashed, checked directory was created.
Change-Id: I468060b20dee0c50033b5f014ce8716582d5e6bc
This commit is contained in:
Oli Lan 2019-12-02 18:27:24 +00:00
parent 94457217cb
commit ac003c4955

View file

@ -155,6 +155,7 @@ static bool prepare_subdirs(const std::string& volume_uuid, int user_id, int fla
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;
// TODO: Return false if this returns false once sure this should succeed.
prepare_dir(sehandle, 0700, 0, 0, misc_de_path + "/apexrollback");
prepare_apex_subdirs(sehandle, misc_de_path);
auto vendor_de_path = android::vold::BuildDataVendorDePath(user_id);
@ -172,6 +173,7 @@ static bool prepare_subdirs(const std::string& volume_uuid, int user_id, int fla
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;
// TODO: Return false if this returns false once sure this should succeed.
prepare_dir(sehandle, 0700, 0, 0, misc_ce_path + "/apexrollback");
prepare_apex_subdirs(sehandle, misc_ce_path);
auto system_ce_path = android::vold::BuildDataSystemCePath(user_id);