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

Commit 5c1a910e authored by Todd Kennedy's avatar Todd Kennedy
Browse files

Create new ephemeral app directory

Bug: 25119046
Change-Id: I829f7ae1df09f2b7af1cd64fbbad6c1f5a2d716d
parent 438afe17
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ dir_rec_t android_data_dir;
dir_rec_t android_asec_dir;
dir_rec_t android_app_dir;
dir_rec_t android_app_private_dir;
dir_rec_t android_app_ephemeral_dir;
dir_rec_t android_app_lib_dir;
dir_rec_t android_media_dir;
dir_rec_t android_mnt_expand_dir;
+9 −1
Original line number Diff line number Diff line
@@ -346,6 +346,11 @@ int initialize_globals() {
        return -1;
    }

    // Get the android ephemeral app directory.
    if (copy_and_append(&android_app_ephemeral_dir, &android_data_dir, EPHEMERAL_APP_SUBDIR) < 0) {
        return -1;
    }

    // Get the android app native library directory.
    if (copy_and_append(&android_app_lib_dir, &android_data_dir, APP_LIB_SUBDIR) < 0) {
        return -1;
@@ -367,7 +372,7 @@ int initialize_globals() {
    }

    // Take note of the system and vendor directories.
    android_system_dirs.count = 4;
    android_system_dirs.count = 5;

    android_system_dirs.dirs = (dir_rec_t*) calloc(android_system_dirs.count, sizeof(dir_rec_t));
    if (android_system_dirs.dirs == NULL) {
@@ -393,6 +398,9 @@ int initialize_globals() {
    android_system_dirs.dirs[3].path = strdup("/oem/app/");
    android_system_dirs.dirs[3].len = strlen(android_system_dirs.dirs[3].path);

    android_system_dirs.dirs[4].path = build_string2(android_root_dir.path, EPHEMERAL_APP_SUBDIR);
    android_system_dirs.dirs[4].len = strlen(android_system_dirs.dirs[4].path);

    return 0;
}

+2 −0
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@

#define APP_SUBDIR             "app/" // sub-directory under ANDROID_DATA
#define PRIV_APP_SUBDIR        "priv-app/" // sub-directory under ANDROID_DATA
#define EPHEMERAL_APP_SUBDIR   "app-ephemeral/" // sub-directory under ANDROID_DATA

#define APP_LIB_SUBDIR         "app-lib/" // sub-directory under ANDROID_DATA

@@ -124,6 +125,7 @@ typedef struct {

extern dir_rec_t android_app_dir;
extern dir_rec_t android_app_private_dir;
extern dir_rec_t android_app_ephemeral_dir;
extern dir_rec_t android_app_lib_dir;
extern dir_rec_t android_data_dir;
extern dir_rec_t android_asec_dir;
+2 −0
Original line number Diff line number Diff line
@@ -1079,6 +1079,8 @@ static int validate_apk_path_internal(const char *path, int maxSubdirs) {
        dir = &android_app_dir;
    } else if (!strncmp(path, android_app_private_dir.path, android_app_private_dir.len)) {
        dir = &android_app_private_dir;
    } else if (!strncmp(path, android_app_ephemeral_dir.path, android_app_ephemeral_dir.len)) {
        dir = &android_app_ephemeral_dir;
    } else if (!strncmp(path, android_asec_dir.path, android_asec_dir.len)) {
        dir = &android_asec_dir;
    } else if (!strncmp(path, android_mnt_expand_dir.path, android_mnt_expand_dir.len)) {