summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorctso <ctsoyars@gmail.com>2010-06-24 02:03:47 +0000
committerctso <ctsoyars@gmail.com>2010-06-24 02:03:47 +0000
commit78abd673551b2e562ce17207c5904567c8e72b94 (patch)
tree7f06bd317b7233bae986f3c8025eb4ba6fbf663a
parent1a3ddc6126a1008bdf2e958d4e0ef7754a4f0d6d (diff)
downloadframeworks_base-78abd673551b2e562ce17207c5904567c8e72b94.zip
frameworks_base-78abd673551b2e562ce17207c5904567c8e72b94.tar.gz
frameworks_base-78abd673551b2e562ce17207c5904567c8e72b94.tar.bz2
DexOpt anything on /system in /cache/dalvik-cache
Change-Id: Id41d37047f2fcb90d513ac091dfcb85492473689
-rw-r--r--cmds/installd/commands.c8
-rw-r--r--cmds/installd/installd.h1
2 files changed, 6 insertions, 3 deletions
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c
index cce7c13..ccc6601 100644
--- a/cmds/installd/commands.c
+++ b/cmds/installd/commands.c
@@ -417,7 +417,9 @@ int create_cache_path(char path[PKG_PATH_MAX], const char *src)
return -1;
}
- dstlen = srclen + strlen(DALVIK_CACHE_PREFIX) +
+ const char *cache_path = strncmp(src, "/system", 7) ? DALVIK_CACHE_PREFIX : DALVIK_SYSTEM_CACHE_PREFIX;
+
+ dstlen = srclen + strlen(cache_path) +
strlen(DALVIK_CACHE_POSTFIX) + 1;
if (dstlen > PKG_PATH_MAX) {
@@ -425,11 +427,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 cfcdb98..fc63b9f 100644
--- a/cmds/installd/installd.h
+++ b/cmds/installd/installd.h
@@ -64,6 +64,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/"