diff options
| author | 2023-08-02 17:44:43 +0100 | |
|---|---|---|
| committer | 2023-08-02 20:59:55 +0100 | |
| commit | 2aea00b81119465788a0526bd07ebf389ea7a25f (patch) | |
| tree | e577831c39991904bef90a0189c2ee6cd38b827b | |
| parent | 5a16dd2e237024ed9ee78ca456053d682ad66d86 (diff) | |
Ensure dex2oat is run with background priority for OTA dexopt.
This makes us query `dalvik.vm.background-dex2oat-cpu-set` and
`dalvik.vm.background-dex2oat-threads` for those runs.
A test run shows that `DEXOPT_BOOTCOMPLETE` is propagated from
`OtaDexoptService`, but set it anyway to be certain.
Test: Apply OTA and check that `boot_complete` and
`background_job_compile` get set in `android::installd::dexopt`.
Bug: 237017087
Change-Id: I48627dd062fb6155c826d48b7caefeec36f0cfff
| -rw-r--r-- | cmds/installd/otapreopt.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cmds/installd/otapreopt.cpp b/cmds/installd/otapreopt.cpp index 7cabdb09e1..407cb244e3 100644 --- a/cmds/installd/otapreopt.cpp +++ b/cmds/installd/otapreopt.cpp @@ -471,13 +471,18 @@ private: // TODO(calin): embed the profile name in the parameters. int Dexopt() { std::string error; + + int dexopt_flags = parameters_.dexopt_flags; + // Make sure dex2oat is run with background priority. + dexopt_flags |= DEXOPT_BOOTCOMPLETE | DEXOPT_IDLE_BACKGROUND_JOB; + int res = dexopt(parameters_.apk_path, parameters_.uid, parameters_.pkgName, parameters_.instruction_set, parameters_.dexopt_needed, parameters_.oat_dir, - parameters_.dexopt_flags, + dexopt_flags, parameters_.compiler_filter, parameters_.volume_uuid, parameters_.shared_libraries, |