Loading cmds/installd/commands.c +1 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ /* Directory records that are used in execution of commands. */ dir_rec_t android_data_dir; dir_rec_t android_datadata_dir; dir_rec_t android_asec_dir; dir_rec_t android_app_dir; dir_rec_t android_app_private_dir; Loading cmds/installd/installd.c +5 −0 Original line number Diff line number Diff line Loading @@ -274,6 +274,11 @@ int initialize_globals() { return -1; } // Get the android datadata directory. if (copy_and_append(&android_datadata_dir, &android_data_dir, DATA_SUBDIR) < 0) { return -1; } // Get the android app directory. if (copy_and_append(&android_app_dir, &android_data_dir, APP_SUBDIR) < 0) { return -1; Loading cmds/installd/installd.h +3 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,8 @@ #define CACHE_DIR_POSTFIX "/cache" #define DATA_SUBDIR "data/" // sub-directory under ANDROID_DATA #define APP_SUBDIR "app/" // sub-directory under ANDROID_DATA #define APP_LIB_SUBDIR "app-lib/" // sub-directory under ANDROID_DATA Loading Loading @@ -98,6 +100,7 @@ extern dir_rec_t android_app_dir; extern dir_rec_t android_app_private_dir; extern dir_rec_t android_app_lib_dir; extern dir_rec_t android_data_dir; extern dir_rec_t android_datadata_dir; extern dir_rec_t android_asec_dir; extern dir_rec_t android_media_dir; extern dir_rec_array_t android_system_dirs; Loading cmds/installd/utils.c +5 −1 Original line number Diff line number Diff line Loading @@ -362,7 +362,11 @@ int lookup_media_dir(char basepath[PATH_MAX], const char *dir) int64_t data_disk_free() { struct statfs sfs; if (statfs(android_data_dir.path, &sfs) == 0) { /* Scanning /data/data because on some devices, it's on a different partition * and scanning /data will yield the incorrect result. (This function is only * used for freeing space on /data/data so it is okay to be more specific.) */ if (statfs(android_datadata_dir.path, &sfs) == 0) { return sfs.f_bavail * sfs.f_bsize; } else { ALOGE("Couldn't statfs %s: %s\n", android_data_dir.path, strerror(errno)); Loading Loading
cmds/installd/commands.c +1 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ /* Directory records that are used in execution of commands. */ dir_rec_t android_data_dir; dir_rec_t android_datadata_dir; dir_rec_t android_asec_dir; dir_rec_t android_app_dir; dir_rec_t android_app_private_dir; Loading
cmds/installd/installd.c +5 −0 Original line number Diff line number Diff line Loading @@ -274,6 +274,11 @@ int initialize_globals() { return -1; } // Get the android datadata directory. if (copy_and_append(&android_datadata_dir, &android_data_dir, DATA_SUBDIR) < 0) { return -1; } // Get the android app directory. if (copy_and_append(&android_app_dir, &android_data_dir, APP_SUBDIR) < 0) { return -1; Loading
cmds/installd/installd.h +3 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,8 @@ #define CACHE_DIR_POSTFIX "/cache" #define DATA_SUBDIR "data/" // sub-directory under ANDROID_DATA #define APP_SUBDIR "app/" // sub-directory under ANDROID_DATA #define APP_LIB_SUBDIR "app-lib/" // sub-directory under ANDROID_DATA Loading Loading @@ -98,6 +100,7 @@ extern dir_rec_t android_app_dir; extern dir_rec_t android_app_private_dir; extern dir_rec_t android_app_lib_dir; extern dir_rec_t android_data_dir; extern dir_rec_t android_datadata_dir; extern dir_rec_t android_asec_dir; extern dir_rec_t android_media_dir; extern dir_rec_array_t android_system_dirs; Loading
cmds/installd/utils.c +5 −1 Original line number Diff line number Diff line Loading @@ -362,7 +362,11 @@ int lookup_media_dir(char basepath[PATH_MAX], const char *dir) int64_t data_disk_free() { struct statfs sfs; if (statfs(android_data_dir.path, &sfs) == 0) { /* Scanning /data/data because on some devices, it's on a different partition * and scanning /data will yield the incorrect result. (This function is only * used for freeing space on /data/data so it is okay to be more specific.) */ if (statfs(android_datadata_dir.path, &sfs) == 0) { return sfs.f_bavail * sfs.f_bsize; } else { ALOGE("Couldn't statfs %s: %s\n", android_data_dir.path, strerror(errno)); Loading