aboutsummaryrefslogtreecommitdiffstats
path: root/android/avd/info.c
diff options
context:
space:
mode:
Diffstat (limited to 'android/avd/info.c')
-rw-r--r--android/avd/info.c41
1 files changed, 23 insertions, 18 deletions
diff --git a/android/avd/info.c b/android/avd/info.c
index aad316a..61142ba 100644
--- a/android/avd/info.c
+++ b/android/avd/info.c
@@ -1130,7 +1130,6 @@ static int
_avdInfo_getImagePaths(AvdInfo* i, AvdInfoParams* params )
{
int wipeData = (params->flags & AVDINFO_WIPE_DATA) != 0;
- int noSdCard = (params->flags & AVDINFO_NO_SDCARD) != 0;
int noSnapshots = (params->flags & AVDINFO_NO_SNAPSHOTS) != 0;
ImageLoader l[1];
@@ -1184,15 +1183,6 @@ _avdInfo_getImagePaths(AvdInfo* i, AvdInfoParams* params )
imageLoader_lock( l, 0 );
}
- /* the SD Card image. unless the user doesn't want to, we're
- * going to mount it if available. Note that if the image is
- * already used, we must ignore it.
- */
- if (!noSdCard) {
- imageLoader_loadOptional(l, AVD_IMAGE_SDCARD,
- params->forcePaths[AVD_IMAGE_SDCARD]);
- }
-
/* the state snapshot image. Mounting behaviour identical to
* SD card.
*/
@@ -1294,7 +1284,6 @@ static int
_avdInfo_getBuildImagePaths( AvdInfo* i, AvdInfoParams* params )
{
int wipeData = (params->flags & AVDINFO_WIPE_DATA) != 0;
- int noSdCard = (params->flags & AVDINFO_NO_SDCARD) != 0;
int noSnapshots = (params->flags & AVDINFO_NO_SNAPSHOTS) != 0;
char temp[PATH_MAX];
@@ -1365,13 +1354,6 @@ _avdInfo_getBuildImagePaths( AvdInfo* i, AvdInfoParams* params )
/* force the system image to read-only status */
l->pState[0] = IMAGE_STATE_READONLY;
- /** SD Card image
- **/
- if (!noSdCard) {
- imageLoader_set (l, AVD_IMAGE_SDCARD);
- imageLoader_load(l, IMAGE_OPTIONAL | IMAGE_IGNORE_IF_LOCKED);
- }
-
/** State snapshots image
**/
if (!noSnapshots) {
@@ -1526,6 +1508,29 @@ char* avdInfo_getDefaultCachePath( AvdInfo* i )
return _getFullFilePath(i->contentPath, imageName);
}
+char* avdInfo_getSdCardPath( AvdInfo* i )
+{
+ const char* imageName = _imageFileNames[ AVD_IMAGE_SDCARD ];
+ char* path;
+
+ /* Special case, the config.ini can have a SDCARD_PATH entry
+ * that gives the full path to the SD Card.
+ */
+ if (i->configIni != NULL) {
+ path = iniFile_getString(i->configIni, SDCARD_PATH, NULL);
+ if (path != NULL) {
+ if (path_exists(path))
+ return path;
+
+ dwarning("Ignoring invalid SDCard path: %s", path);
+ AFREE(path);
+ }
+ }
+
+ /* Otherwise, simply look into the content directory */
+ return _avdInfo_getContentFilePath(i, imageName);
+}
+
char*
avdInfo_getSystemInitImagePath( AvdInfo* i )
{