diff options
author | ctso <ctsoyars@gmail.com> | 2010-06-24 02:03:47 +0000 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2011-01-10 00:06:33 -0500 |
commit | e2319e46f16b71e71e5e9cd593019edaa48c1be0 (patch) | |
tree | 7fef546e9ff871661e87aeea2aec1c81e53be792 /cmds | |
parent | ddd25e44389ab37de26301159c75b5b906cf17c9 (diff) | |
download | frameworks_base-e2319e46f16b71e71e5e9cd593019edaa48c1be0.zip frameworks_base-e2319e46f16b71e71e5e9cd593019edaa48c1be0.tar.gz frameworks_base-e2319e46f16b71e71e5e9cd593019edaa48c1be0.tar.bz2 |
DexOpt anything on /system in /cache/dalvik-cache
Change-Id: Id41d37047f2fcb90d513ac091dfcb85492473689
Allow property to disable dexopt on /cache
Change-Id: Ic74707c4bead387bbf82e4c6d5037efc2d2ebeaf
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/installd/commands.c | 15 | ||||
-rw-r--r-- | cmds/installd/installd.h | 1 |
2 files changed, 13 insertions, 3 deletions
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c index 2f03c7a..176d10c 100644 --- a/cmds/installd/commands.c +++ b/cmds/installd/commands.c @@ -475,6 +475,7 @@ int create_cache_path(char path[PKG_PATH_MAX], const char *src) char *tmp; int srclen; int dstlen; + char dexopt_data_only[PROPERTY_VALUE_MAX]; srclen = strlen(src); @@ -487,7 +488,15 @@ int create_cache_path(char path[PKG_PATH_MAX], const char *src) return -1; } - dstlen = srclen + strlen(DALVIK_CACHE_PREFIX) + + const char *cache_path = DALVIK_CACHE_PREFIX; + if (!strncmp(src, "/system", 7)) { + property_get("dalvik.vm.dexopt-data-only", dexopt_data_only, ""); + if (strcmp(dexopt_data_only, "1") != 0) { + cache_path = DALVIK_SYSTEM_CACHE_PREFIX; + } + } + + dstlen = srclen + strlen(cache_path) + strlen(DALVIK_CACHE_POSTFIX) + 1; if (dstlen > PKG_PATH_MAX) { @@ -495,11 +504,11 @@ int create_cache_path(char path[PKG_PATH_MAX], const char *src) } sprintf(path,"%s%s%s", - DALVIK_CACHE_PREFIX, + cache_path, src + 1, /* skip the leading / */ DALVIK_CACHE_POSTFIX); - for(tmp = path + strlen(DALVIK_CACHE_PREFIX); *tmp; tmp++) { + for(tmp = path + strlen(cache_path); *tmp; tmp++) { if (*tmp == '/') { *tmp = '@'; } diff --git a/cmds/installd/installd.h b/cmds/installd/installd.h index 59475e9..ffb22b6 100644 --- a/cmds/installd/installd.h +++ b/cmds/installd/installd.h @@ -73,6 +73,7 @@ #define SDCARD_DIR_PREFIX getenv("ASEC_MOUNTPOINT") #define DALVIK_CACHE_PREFIX "/data/dalvik-cache/" +#define DALVIK_SYSTEM_CACHE_PREFIX "/cache/dalvik-cache/" #define DALVIK_CACHE_POSTFIX "/classes.dex" #define UPDATE_COMMANDS_DIR_PREFIX "/system/etc/updatecmds/" |