From 3a68f141927a8a473b1e7aca11fb1b20ddda77b3 Mon Sep 17 00:00:00 2001 From: Calin Juravle Date: Fri, 3 Mar 2017 17:51:35 -0800 Subject: [PATCH] Vold: Clean up code related to foreign dex use We simplified the way we track whether or not a dex file is used by other apps. DexManger in the framework keeps track of the data and we no longer need file markers on disk. Test: device boots, foreign dex markers are not created anymore Bug: 32871170 Change-Id: Id0360205b019be92049f36eab4339f4736e974f4 --- Ext4Crypt.cpp | 4 ---- Utils.cpp | 5 ----- Utils.h | 1 - 3 files changed, 10 deletions(-) diff --git a/Ext4Crypt.cpp b/Ext4Crypt.cpp index 0063bef..969ab0b 100644 --- a/Ext4Crypt.cpp +++ b/Ext4Crypt.cpp @@ -685,7 +685,6 @@ bool e4crypt_prepare_user_storage(const char* volume_uuid, userid_t user_id, int auto system_legacy_path = android::vold::BuildDataSystemLegacyPath(user_id); auto misc_legacy_path = android::vold::BuildDataMiscLegacyPath(user_id); auto profiles_de_path = android::vold::BuildDataProfilesDePath(user_id); - auto foreign_de_path = android::vold::BuildDataProfilesForeignDexDePath(user_id); // DE_n key auto system_de_path = android::vold::BuildDataSystemDePath(user_id); @@ -698,7 +697,6 @@ bool e4crypt_prepare_user_storage(const char* volume_uuid, userid_t user_id, int multiuser_get_uid(user_id, AID_EVERYBODY))) return false; #endif if (!prepare_dir(profiles_de_path, 0771, AID_SYSTEM, AID_SYSTEM)) return false; - if (!prepare_dir(foreign_de_path, 0773, AID_SYSTEM, AID_SYSTEM)) return false; if (!prepare_dir(system_de_path, 0770, AID_SYSTEM, AID_SYSTEM)) return false; if (!prepare_dir(misc_de_path, 01771, AID_SYSTEM, AID_MISC)) return false; @@ -756,7 +754,6 @@ bool e4crypt_destroy_user_storage(const char* volume_uuid, userid_t user_id, int auto system_legacy_path = android::vold::BuildDataSystemLegacyPath(user_id); auto misc_legacy_path = android::vold::BuildDataMiscLegacyPath(user_id); auto profiles_de_path = android::vold::BuildDataProfilesDePath(user_id); - auto foreign_de_path = android::vold::BuildDataProfilesForeignDexDePath(user_id); // DE_n key auto system_de_path = android::vold::BuildDataSystemDePath(user_id); @@ -769,7 +766,6 @@ bool e4crypt_destroy_user_storage(const char* volume_uuid, userid_t user_id, int res &= destroy_dir(misc_legacy_path); #endif res &= destroy_dir(profiles_de_path); - res &= destroy_dir(foreign_de_path); res &= destroy_dir(system_de_path); res &= destroy_dir(misc_de_path); } diff --git a/Utils.cpp b/Utils.cpp index 17e9ffd..b4fc208 100644 --- a/Utils.cpp +++ b/Utils.cpp @@ -589,11 +589,6 @@ std::string BuildDataProfilesDePath(userid_t userId) { return StringPrintf("%s/misc/profiles/cur/%u", BuildDataPath(nullptr).c_str(), userId); } -std::string BuildDataProfilesForeignDexDePath(userid_t userId) { - std::string profiles_path = BuildDataProfilesDePath(userId); - return StringPrintf("%s/foreign-dex", profiles_path.c_str()); -} - std::string BuildDataPath(const char* volumeUuid) { // TODO: unify with installd path generation logic if (volumeUuid == nullptr) { diff --git a/Utils.h b/Utils.h index 4bfd8e9..ddabace 100644 --- a/Utils.h +++ b/Utils.h @@ -103,7 +103,6 @@ std::string BuildDataMiscLegacyPath(userid_t userid); std::string BuildDataMiscCePath(userid_t userid); std::string BuildDataMiscDePath(userid_t userid); std::string BuildDataProfilesDePath(userid_t userid); -std::string BuildDataProfilesForeignDexDePath(userid_t userid); std::string BuildDataPath(const char* volumeUuid); std::string BuildDataMediaCePath(const char* volumeUuid, userid_t userid);