summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorctso <ctsoyars@gmail.com>2010-06-24 07:51:41 +0000
committerctso <ctsoyars@gmail.com>2010-06-24 07:51:41 +0000
commit0587d8fa994f68a0057b90bdbcd37278938e2c24 (patch)
tree107793e1b1963d42cc351c46ba095947c4e46abf
parentc656b7775c69855a6e2dc64c6a52b20acb8103d2 (diff)
downloadandroid_dalvik-0587d8fa994f68a0057b90bdbcd37278938e2c24.tar.gz
android_dalvik-0587d8fa994f68a0057b90bdbcd37278938e2c24.tar.bz2
android_dalvik-0587d8fa994f68a0057b90bdbcd37278938e2c24.zip
Allow system property to disable use of /cache for dexfiles.
-rw-r--r--libdex/OptInvocation.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/libdex/OptInvocation.c b/libdex/OptInvocation.c
index b623d1446..9ed63393a 100644
--- a/libdex/OptInvocation.c
+++ b/libdex/OptInvocation.c
@@ -30,6 +30,8 @@
#include "OptInvocation.h"
#include "DexFile.h"
+#include <cutils/properties.h>
+
static const char* kClassesDex = "classes.dex";
@@ -53,6 +55,7 @@ char* dexOptGenerateCacheFileName(const char* fileName, const char* subFileName)
const char* cacheRoot;
const char* systemRoot;
char* cp;
+ char dexoptDataOnly[PROPERTY_VALUE_MAX];
/*
* Get the absolute path of the Jar or DEX file.
@@ -115,8 +118,12 @@ char* dexOptGenerateCacheFileName(const char* fileName, const char* subFileName)
dexRoot = "/data";
/* Cache anything stored on /system in cacheRoot, everything else in dataRoot */
- if (!strncmp(absoluteFile, systemRoot, strlen(systemRoot)))
- dexRoot = cacheRoot;
+ if (!strncmp(absoluteFile, systemRoot, strlen(systemRoot))) {
+ property_get("dalvik.vm.dexopt-data-only", dexoptDataOnly, "");
+ if (strcmp(dexoptDataOnly, "1") != 0) {
+ dexRoot = cacheRoot;
+ }
+ }
snprintf(nameBuf, kBufLen, "%s/%s", dexRoot, kDexCachePath);