diff options
author | David Turner <> | 2009-04-05 14:23:06 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-04-05 14:23:06 -0700 |
commit | 4735694ff99078f961876525ebbd55317956083f (patch) | |
tree | 0d6058c84618d7b2b30ef2b6a7d105f11dc01802 /android/avd/info.c | |
parent | e8b10bc4023bf84dcdb11940bbad9baf81bdd02c (diff) | |
download | external_qemu-4735694ff99078f961876525ebbd55317956083f.zip external_qemu-4735694ff99078f961876525ebbd55317956083f.tar.gz external_qemu-4735694ff99078f961876525ebbd55317956083f.tar.bz2 |
AI 144597: am: CL 144596 am: CL 144595 Fix the AVD configuration code to support "sdcard.path" in config.ini to indicate an explicit SD Card image file (instead of using the one in the content directory)
Note that this also fix a bug where the SD Card image was not properly locked in the previous implementation.
Allow the http-proxy support code to actually manage to receive chunked encoding data, instead of complaining needlessly.
Introduce a new CharBuffer object that is used indirectly by "-radio <hostdevice>" and "-gps <hostdevice>" options
Add new documentation for QEMUD and CharDriverState objects
Update the Audio documentation with ASCII graphics (because I'm an artist too)
Original author: digit
Merged from: //branches/cupcake/...
Original author: android-build
Automated import of CL 144597
Diffstat (limited to 'android/avd/info.c')
-rw-r--r-- | android/avd/info.c | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/android/avd/info.c b/android/avd/info.c index 11c5d19..ec74249 100644 --- a/android/avd/info.c +++ b/android/avd/info.c @@ -86,6 +86,12 @@ AvdInfo* android_avdInfo; /* default skin name */ #define SKIN_DEFAULT "HVGA" +/* the config.ini key that is used to indicate the absolute path + * to the SD Card image file, if you don't want to place it in + * the content directory. + */ +#define SDCARD_PATH "sdcard.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 @@ -591,7 +597,12 @@ imageLoader_load( ImageLoader* l, { const char* path = NULL; - /* first, check user-provided path */ + /* set image state */ + l->pState[0] = (flags & IMAGE_DONT_LOCK) == 0 + ? IMAGE_STATE_MUSTLOCK + : IMAGE_STATE_READONLY; + + /* check user-provided path */ path = l->params->forcePaths[l->id]; if (path != NULL) { imageLoader_setPath(l, path); @@ -696,7 +707,7 @@ _getImagePaths(AvdInfo* i, AvdInfoParams* params ) * and use it. */ imageLoader_set ( l, AVD_IMAGE_INITSYSTEM ); - imageLoader_load( l, IMAGE_REQUIRED | IMAGE_SEARCH_SDK ); + imageLoader_load( l, IMAGE_REQUIRED | IMAGE_SEARCH_SDK | IMAGE_DONT_LOCK ); /* the data partition - this one is special because if it * is missing, we need to copy the initial image file into it. @@ -1031,6 +1042,24 @@ _getSkin( AvdInfo* i, AvdInfoParams* params ) return 0; } +/* If the user didn't explicitely provide an SD Card path, + * check the SDCARD_PATH key in config.ini and use that if + * available. + */ +static void +_getSDCardPath( AvdInfo* i, AvdInfoParams* params ) +{ + const char* path; + + if (params->forcePaths[AVD_IMAGE_SDCARD] != NULL) + return; + + path = iniFile_getString(i->configIni, SDCARD_PATH); + if (path == NULL) + return; + + params->forcePaths[AVD_IMAGE_SDCARD] = path; +} AvdInfo* avdInfo_new( const char* name, AvdInfoParams* params ) @@ -1058,6 +1087,7 @@ avdInfo_new( const char* name, AvdInfoParams* params ) * obsolete SDKs. */ _getSearchPaths(i); + _getSDCardPath(i, params); /* don't need this anymore */ iniFile_free(i->rootIni); |