Add new dexopt flag to control CompactDex generation
Add a new flag to control CompactDex generation, this allows more
flexibility regarding when compact dex is generated.
The goal is to generate it for cmd package compile.
Bug: 63756964
Bug: 74245837
Test: adb shell /data/nativetest64/installd_dexopt_test/installd_dexopt_test
Change-Id: I0674f50bbb7413b67e6fbab3199f5c7e78ec875c
diff --git a/cmds/installd/installd_constants.h b/cmds/installd/installd_constants.h
index 6282ba2..26aa443 100644
--- a/cmds/installd/installd_constants.h
+++ b/cmds/installd/installd_constants.h
@@ -53,6 +53,7 @@
// controls whether extra debugging flags can be used (taking more compile time.)
constexpr int DEXOPT_IDLE_BACKGROUND_JOB = 1 << 9;
constexpr int DEXOPT_ENABLE_HIDDEN_API_CHECKS = 1 << 10;
+constexpr int DEXOPT_GENERATE_COMPACT_DEX = 1 << 11;
/* all known values for dexopt flags */
constexpr int DEXOPT_MASK =
@@ -65,7 +66,8 @@
| DEXOPT_STORAGE_CE
| DEXOPT_STORAGE_DE
| DEXOPT_IDLE_BACKGROUND_JOB
- | DEXOPT_ENABLE_HIDDEN_API_CHECKS;
+ | DEXOPT_ENABLE_HIDDEN_API_CHECKS
+ | DEXOPT_GENERATE_COMPACT_DEX;
// NOTE: keep in sync with StorageManager
constexpr int FLAG_STORAGE_DE = 1 << 0;