installd: Consider bundled app dir as a valid apk path

Change-Id: I92db56f21bf91e0816b63faffcfbb270ca2d8fca
This commit is contained in:
Steve Kondik 2015-11-07 17:52:50 -08:00
parent 4cf9742078
commit 911c7f3338
4 changed files with 12 additions and 0 deletions

View File

@ -39,6 +39,7 @@ dir_rec_t android_app_private_dir;
dir_rec_t android_app_lib_dir;
dir_rec_t android_media_dir;
dir_rec_t android_mnt_expand_dir;
dir_rec_t android_prebundled_dir;
dir_rec_array_t android_system_dirs;
static const char* kCpPath = "/system/bin/cp";

View File

@ -385,6 +385,12 @@ int initialize_globals() {
return -1;
}
// Get the android external app directory.
if (get_path_from_string(&android_prebundled_dir, PREBUNDLED_APP_PREFIX) < 0) {
return -1;
}
// Take note of the system and vendor directories.
android_system_dirs.count = 4;

View File

@ -92,6 +92,8 @@
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
#define PREBUNDLED_APP_PREFIX "/vendor/bundled-app/"
/* data structures */
typedef struct {
@ -111,6 +113,7 @@ extern dir_rec_t android_data_dir;
extern dir_rec_t android_asec_dir;
extern dir_rec_t android_media_dir;
extern dir_rec_t android_mnt_expand_dir;
extern dir_rec_t android_prebundled_dir;
extern dir_rec_array_t android_system_dirs;
typedef struct cache_dir_struct {

View File

@ -1061,6 +1061,8 @@ static int validate_apk_path_internal(const char *path, int maxSubdirs) {
if (maxSubdirs < 2) {
maxSubdirs = 2;
}
} else if (!strncmp(path, android_prebundled_dir.path, android_prebundled_dir.len)) {
dir = &android_prebundled_dir;
} else {
return -1;
}