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

Commit 3839d19a authored by David Brazdil's avatar David Brazdil Committed by android-build-merger
Browse files

Merge "installd: Simplify Dalvik cache path creation" am: ad95fc06 am: c3ca770d

am: c0c8dad0

Change-Id: Ic99a44e0d137f7c26106ff45776500a75b6827d9
parents d948343f c0c8dad0
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -151,12 +151,11 @@ bool create_cache_path(char path[PKG_PATH_MAX],
        return false;
    }

    sprintf(path,"%s%s/%s/%s%s",
    sprintf(path,"%s%s/%s/%s",
            android_data_dir.path,
            DALVIK_CACHE,
            instruction_set,
            src + 1, /* skip the leading / */
            DALVIK_CACHE_POSTFIX);
            src + 1 /* skip the leading / */);

    char* tmp =
            path +
@@ -171,6 +170,7 @@ bool create_cache_path(char path[PKG_PATH_MAX],
        }
    }

    strcat(path, DALVIK_CACHE_POSTFIX);
    return true;
}

+1 −2
Original line number Diff line number Diff line
@@ -28,8 +28,7 @@ constexpr const char* SECONDARY_USER_PREFIX = "user/";

// This is used as a string literal, can't be constants. TODO: std::string...
#define DALVIK_CACHE "dalvik-cache"
constexpr const char* DALVIK_CACHE_POSTFIX = "/classes.dex";
constexpr const char* DALVIK_CACHE_POSTFIX2 = "@classes.dex";
constexpr const char* DALVIK_CACHE_POSTFIX = "@classes.dex";

constexpr size_t PKG_NAME_MAX = 128u;   /* largest allowed package name */
constexpr size_t PKG_PATH_MAX = 256u;   /* max size of any path we use */
+1 −1
Original line number Diff line number Diff line
@@ -823,7 +823,7 @@ bool create_cache_path(char path[PKG_PATH_MAX],
                                              DALVIK_CACHE,
                                              instruction_set,
                                              from_src.c_str(),
                                              DALVIK_CACHE_POSTFIX2);
                                              DALVIK_CACHE_POSTFIX);

    if (assembled_path.length() + 1 > PKG_PATH_MAX) {
        return false;