Add new dexopt flag to control hidden API restrictions
Allow PackageDexOptimizer to select which APKs should be exempt
from hidden API restrictions by creating a new DEXOPT_ flag and
passing a suitable command line argument to dex2oat if it is set.
Bug: 64382372
Test: installd_dexopt_test
Change-Id: I86917c357ced7fa04d8bb500669b76bbd4c08f2c
diff --git a/cmds/installd/installd_constants.h b/cmds/installd/installd_constants.h
index b49057d..9b6714d 100644
--- a/cmds/installd/installd_constants.h
+++ b/cmds/installd/installd_constants.h
@@ -52,6 +52,7 @@
// Tells the compiler that it is invoked from the background service. This
// controls whether extra debugging flags can be used (taking more compile time.)
constexpr int DEXOPT_IDLE_BACKGROUND_JOB = 1 << 9;
+constexpr int DEXOPT_DISABLE_HIDDEN_API_CHECKS = 1 << 10;
/* all known values for dexopt flags */
constexpr int DEXOPT_MASK =
@@ -62,7 +63,8 @@
| DEXOPT_SECONDARY_DEX
| DEXOPT_FORCE
| DEXOPT_STORAGE_CE
- | DEXOPT_STORAGE_DE;
+ | DEXOPT_STORAGE_DE
+ | DEXOPT_DISABLE_HIDDEN_API_CHECKS;
// NOTE: keep in sync with StorageManager
constexpr int FLAG_STORAGE_DE = 1 << 0;