Prepare installd to handle profiles per code path
Transform each profile operation to accept the pair
(package_name, profile_name). This will allow installd to get the profile
name from the PackageManager instead of assuming a predefined name. The
PackageManager will compute and assign unique profile names for each code
path.
The end goal is to support installation and extraction of profiles per
code path.
Also, add a few extra tests for merging the profiles.
Test: installd_dexopt_test, installd_utils_test
Bug: 30934496
Change-Id: I580f037d9d3e5537032e815dc803b9ddeff343cb
diff --git a/cmds/installd/utils.h b/cmds/installd/utils.h
index 5391061..b18e7dd 100644
--- a/cmds/installd/utils.h
+++ b/cmds/installd/utils.h
@@ -80,10 +80,17 @@
std::string create_primary_reference_profile_package_dir_path(const std::string& package_name);
std::string create_current_profile_path(
- userid_t user, const std::string& package_name, bool is_secondary_dex);
+ userid_t user,
+ const std::string& package_name,
+ const std::string& location,
+ bool is_secondary_dex);
std::string create_reference_profile_path(
- const std::string& package_name, bool is_secondary_dex);
-std::string create_snapshot_profile_path(const std::string& package, const std::string& code_path);
+ const std::string& package_name,
+ const std::string& location,
+ bool is_secondary_dex);
+std::string create_snapshot_profile_path(
+ const std::string& package,
+ const std::string& profile_name);
std::vector<userid_t> get_known_users(const char* volume_uuid);