From 0587d8fa994f68a0057b90bdbcd37278938e2c24 Mon Sep 17 00:00:00 2001 From: ctso Date: Thu, 24 Jun 2010 07:51:41 +0000 Subject: Allow system property to disable use of /cache for dexfiles. --- libdex/OptInvocation.c | 11 +++++++++-- 1 file 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 + 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); -- cgit v1.2.3