diff options
Diffstat (limited to 'android/avd/info.c')
-rw-r--r-- | android/avd/info.c | 62 |
1 files changed, 23 insertions, 39 deletions
diff --git a/android/avd/info.c b/android/avd/info.c index d726112..5634ef6 100644 --- a/android/avd/info.c +++ b/android/avd/info.c @@ -92,12 +92,6 @@ AvdInfo* android_avdInfo; */ #define SDCARD_PATH "sdcard.path" -/* the config.ini key that is used to indicate the absolute path - * to the second SD Card image file, if you don't want to place it in - * the content directory. - */ -#define SDCARD2_PATH "sdcard2.path" - /* certain disk image files are mounted read/write by the emulator * to ensure that several emulators referencing the same files * do not corrupt these files, we need to lock them and respond @@ -687,26 +681,7 @@ EXIT: return l->pPath[0]; } -static void _sdcardLoadImages(ImageLoader* l, AvdInfo* i, AvdInfoParams* params, AvdImageType sdcardImage) -{ - imageLoader_set(l, sdcardImage); - imageLoader_load(l, IMAGE_OPTIONAL | - IMAGE_IGNORE_IF_LOCKED); - /* if the file was not found, ignore it */ - if (l->pPath[0] && !path_exists(l->pPath[0])) - { - D("ignoring non-existing %s at %s: %s", - l->imageText, l->pPath[0], strerror(errno)); - - /* if the user provided the SD Card path by hand, - * warn him. */ - if (params->forcePaths[sdcardImage] != NULL) - dwarning("ignoring non-existing SD Card image"); - - imageLoader_setPath(l, NULL); - } -} /* find the correct path of all image files we're going to need * and lock the files that need it. @@ -803,8 +778,23 @@ _getImagePaths(AvdInfo* i, AvdInfoParams* params ) * already used, we must ignore it. */ if (!noSdCard) { - _sdcardLoadImages(l, i, params, AVD_IMAGE_SDCARD); - _sdcardLoadImages(l, i, params, AVD_IMAGE_SDCARD2); + imageLoader_set (l, AVD_IMAGE_SDCARD); + imageLoader_load(l, IMAGE_OPTIONAL | + IMAGE_IGNORE_IF_LOCKED); + + /* if the file was not found, ignore it */ + if (l->pPath[0] && !path_exists(l->pPath[0])) + { + D("ignoring non-existing %s at %s: %s", + l->imageText, l->pPath[0], strerror(errno)); + + /* if the user provided the SD Card path by hand, + * warn him. */ + if (params->forcePaths[AVD_IMAGE_SDCARD] != NULL) + dwarning("ignoring non-existing SD Card image"); + + imageLoader_setPath(l, NULL); + } } return 0; @@ -1059,24 +1049,22 @@ _getSkin( AvdInfo* i, AvdInfoParams* params ) } /* If the user didn't explicitely provide an SD Card path, - * check the specfied key in config.ini and use that if + * check the SDCARD_PATH key in config.ini and use that if * available. */ static void -_getSDCardPath(AvdInfo* i, AvdInfoParams* params, AvdImageType sdcardImage, - const char* iniKey ) +_getSDCardPath( AvdInfo* i, AvdInfoParams* params ) { const char* path; - if (params->forcePaths[sdcardImage] != NULL) { + if (params->forcePaths[AVD_IMAGE_SDCARD] != NULL) return; - } - path = iniFile_getString(i->configIni, iniKey); + path = iniFile_getString(i->configIni, SDCARD_PATH); if (path == NULL) return; - params->forcePaths[sdcardImage] = path; + params->forcePaths[AVD_IMAGE_SDCARD] = path; } AvdInfo* @@ -1105,8 +1093,7 @@ avdInfo_new( const char* name, AvdInfoParams* params ) * obsolete SDKs. */ _getSearchPaths(i); - _getSDCardPath(i, params, AVD_IMAGE_SDCARD, SDCARD_PATH); - _getSDCardPath(i, params, AVD_IMAGE_SDCARD2, SDCARD2_PATH); + _getSDCardPath(i, params); /* don't need this anymore */ iniFile_free(i->rootIni); @@ -1274,9 +1261,6 @@ _getBuildImagePaths( AvdInfo* i, AvdInfoParams* params ) if (!noSdCard) { imageLoader_set (l, AVD_IMAGE_SDCARD); imageLoader_load(l, IMAGE_OPTIONAL | IMAGE_IGNORE_IF_LOCKED); - - imageLoader_set (l, AVD_IMAGE_SDCARD2); - imageLoader_load(l, IMAGE_OPTIONAL | IMAGE_IGNORE_IF_LOCKED); } return 0; |