Installd: Introduce otapreopt
Add a tool for dexopt during OTA. The tool will use /data/ota as
an ANDROID_ROOT wrt/ the dalvik-cache, compiling a new boot image
and system apps into this directory. Other apps will be compiled
to odex files suffixed with ".b".
Bug: 25612095
Change-Id: I6ac382973f13850f6b37402a1b2330c0014b47d9
diff --git a/cmds/installd/installd_constants.h b/cmds/installd/installd_constants.h
index 18f998d..0d21519 100644
--- a/cmds/installd/installd_constants.h
+++ b/cmds/installd/installd_constants.h
@@ -48,6 +48,7 @@
// This is used as a string literal, can't be constants. TODO: std::string...
#define DALVIK_CACHE "dalvik-cache"
constexpr const char* DALVIK_CACHE_POSTFIX = "/classes.dex";
+constexpr const char* DALVIK_CACHE_POSTFIX2 = "@classes.dex";
constexpr const char* IDMAP_PREFIX = "/data/resource-cache/";
constexpr const char* IDMAP_SUFFIX = "@idmap";
@@ -74,6 +75,7 @@
constexpr int DEXOPT_DEBUGGABLE = 1 << 3;
constexpr int DEXOPT_BOOTCOMPLETE = 1 << 4;
constexpr int DEXOPT_EXTRACTONLY = 1 << 5;
+constexpr int DEXOPT_OTA = 1 << 6;
/* all known values for dexopt flags */
constexpr int DEXOPT_MASK =
@@ -81,7 +83,8 @@
| DEXOPT_SAFEMODE
| DEXOPT_DEBUGGABLE
| DEXOPT_BOOTCOMPLETE
- | DEXOPT_EXTRACTONLY;
+ | DEXOPT_EXTRACTONLY
+ | DEXOPT_OTA;
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))