Installd: 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. DexManager in the framework keeps track of the data and we
no longer need file markers on disk.
Also, fix the getUserSize by considering the size of the actual profiles
not of the set of empty markers.
Test: device boots, foreign dex markers are not created anymore
Bug: 32871170
Change-Id: I9250e816a1bfa95cb10155e513ae28ebfda7ce4b
diff --git a/cmds/installd/InstalldNativeService.cpp b/cmds/installd/InstalldNativeService.cpp
index f2ea0d3..29eb6e5 100644
--- a/cmds/installd/InstalldNativeService.cpp
+++ b/cmds/installd/InstalldNativeService.cpp
@@ -1238,7 +1238,7 @@
calculate_tree_size(create_data_dalvik_cache_path(), &stats.codeSize,
sharedGid, -1);
}
- calculate_tree_size(create_data_misc_foreign_dex_path(userId), &stats.dataSize,
+ calculate_tree_size(create_data_user_profile_path(userId), &stats.dataSize,
multiuser_get_uid(userId, appId), -1);
ATRACE_END();
}
@@ -1336,7 +1336,7 @@
ATRACE_BEGIN("dalvik");
calculate_tree_size(create_data_dalvik_cache_path(), &stats.codeSize,
-1, -1, true);
- calculate_tree_size(create_data_misc_foreign_dex_path(userId), &stats.dataSize,
+ calculate_tree_size(create_data_user_profile_path(userId), &stats.dataSize,
-1, -1, true);
ATRACE_END();
@@ -1386,7 +1386,7 @@
ATRACE_BEGIN("dalvik");
calculate_tree_size(create_data_dalvik_cache_path(), &stats.codeSize);
- calculate_tree_size(create_data_misc_foreign_dex_path(userId), &stats.dataSize);
+ calculate_tree_size(create_data_user_profile_path(userId), &stats.dataSize);
ATRACE_END();
}
diff --git a/cmds/installd/utils.cpp b/cmds/installd/utils.cpp
index 1abf2b6..7c40ef7 100644
--- a/cmds/installd/utils.cpp
+++ b/cmds/installd/utils.cpp
@@ -235,10 +235,6 @@
return "/data/dalvik-cache";
}
-std::string create_data_misc_foreign_dex_path(userid_t userid) {
- return StringPrintf("/data/misc/profiles/cur/%d/foreign-dex", userid);
-}
-
// Keep profile paths in sync with ActivityThread.
constexpr const char* PRIMARY_PROFILE_NAME = "primary.prof";
diff --git a/cmds/installd/utils.h b/cmds/installd/utils.h
index 6cd5aee..425b675 100644
--- a/cmds/installd/utils.h
+++ b/cmds/installd/utils.h
@@ -101,7 +101,6 @@
std::string create_data_ref_profile_package_path(const char* package_name);
std::string create_data_dalvik_cache_path();
-std::string create_data_misc_foreign_dex_path(userid_t userid);
std::string create_primary_profile(const std::string& profile_dir);