diff options
Diffstat (limited to 'cmds/installd/commands.c')
-rw-r--r-- | cmds/installd/commands.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c index 387f33d..a44d626 100644 --- a/cmds/installd/commands.c +++ b/cmds/installd/commands.c @@ -600,6 +600,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); @@ -612,7 +613,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) { @@ -620,11 +629,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 = '@'; } |