Force the compilation reason of otapreopt to be "ab-ota".
The legacy code in the package manager uses "first-boot" as the
compilation reason for otapreopt when it wants to query
"pm.dexopt.first-boot" for the compiler filter. This causes confusion.
Bug: 307903002
Change-Id: I73c1178684f9056dc2d87e6f8d0379a64ac387c3
Test: Presubmit
diff --git a/cmds/installd/otapreopt.cpp b/cmds/installd/otapreopt.cpp
index 822ab7f..8eb7458 100644
--- a/cmds/installd/otapreopt.cpp
+++ b/cmds/installd/otapreopt.cpp
@@ -514,6 +514,8 @@
// Make sure dex2oat is run with background priority.
dexopt_flags |= DEXOPT_BOOTCOMPLETE | DEXOPT_IDLE_BACKGROUND_JOB;
+ parameters_.compilation_reason = "ab-ota";
+
int res = dexopt(parameters_.apk_path,
parameters_.uid,
parameters_.pkgName,