[installd] Prepare profiles for app code paths
Implement profile preparation for individual application code paths.
The preparation is:
- create the current profile
- merge the profile from the dex metadata file (if present) into the
reference profile.
Note: currently the current profile is created as part of
InstalldNativeService::createAppData for the entire package. That logic
does not support dex metadata or individual code paths and will be removed
once the PackageManager switches over the new method.
(cherry picked from commit bc5ab878b56bcd3a300cc5fc0facc864421dfcb6)
Test: installd_dexopt_test
Bug: 30934496
Merged-In: I2aeddcda7b78017bd46838985bef5f92a79d4573
Change-Id: I2aeddcda7b78017bd46838985bef5f92a79d4573
diff --git a/cmds/installd/dexopt.h b/cmds/installd/dexopt.h
index a2baf60..29312d2 100644
--- a/cmds/installd/dexopt.h
+++ b/cmds/installd/dexopt.h
@@ -70,6 +70,17 @@
const std::string& pkgname,
const std::string& profile_name);
+// Prepare the app profile for the given code path:
+// - create the current profile using profile_name
+// - merge the profile from the dex metadata file (if present) into
+// the reference profile.
+bool prepare_app_profile(const std::string& package_name,
+ userid_t user_id,
+ appid_t app_id,
+ const std::string& profile_name,
+ const std::string& code_path,
+ const std::unique_ptr<std::string>& dex_metadata);
+
bool delete_odex(const char* apk_path, const char* instruction_set, const char* output_path);
bool reconcile_secondary_dex_file(const std::string& dex_path,