Fix profile discovery for CompOS.
Files in CompOS are in special folders, so we need to rewrite the paths
before opening the files. A recent refactoring (aosp/2550992) broke it.
This CL is the fix.
Bug: 279232817
Bug: 269230245
Test: atest ComposHostTestCases
Change-Id: Ib732e76bdee486f658666a578028640cdeb143c1
diff --git a/odrefresh/odrefresh.cc b/odrefresh/odrefresh.cc
index 55a6720..9d227fe 100644
--- a/odrefresh/odrefresh.cc
+++ b/odrefresh/odrefresh.cc
@@ -1901,7 +1901,8 @@
InstructionSet isa = config_.GetSystemServerIsa();
std::string output_path = GetSystemServerImagePath(/*on_system=*/false, dex_file);
- std::string profile = dex_file + ".prof";
+ std::string actual_jar_path = RewriteParentDirectoryIfNeeded(dex_file);
+ std::string profile = actual_jar_path + ".prof";
const std::string& compiler_filter = config_.GetSystemServerCompilerFilter();
bool maybe_add_profile = !compiler_filter.empty() || HasVettedDeviceSystemServerProfiles();
bool has_added_profile =