Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a99f6182 authored by Won-Kyu Park's avatar Won-Kyu Park Committed by Steve Kondik
Browse files

DexOpt anything on /system in /cache/dalvik-cache

Allow property to disable dexopt on /cache

(cherry-picked commit e2319e46)

Conflicts:

	cmds/installd/installd.h

Change-Id: I79e5de4b466c6b5175145592f1ca4e6331e4a4ac
parent 8c54d240
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -484,6 +484,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);

@@ -496,7 +497,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) {
@@ -504,11 +513,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 = '@';
        }
+1 −0
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@
#define PRIVATE_APP_SUBDIR     "app-private/" // sub-directory under ANDROID_DATA

#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/"