diff options
author | Xavier Ducrohet <xav@android.com> | 2012-04-19 12:54:08 -0700 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2012-04-19 13:41:24 -0700 |
commit | 689d1147b1994be1d8e33ee4d1a8ec76742bb4a6 (patch) | |
tree | ac1bde51d7298672ccb387d73135163302b23119 /android | |
parent | bdd020b108b63fcfccefb2905b9d0401f739981a (diff) | |
download | external_qemu-689d1147b1994be1d8e33ee4d1a8ec76742bb4a6.zip external_qemu-689d1147b1994be1d8e33ee4d1a8ec76742bb4a6.tar.gz external_qemu-689d1147b1994be1d8e33ee4d1a8ec76742bb4a6.tar.bz2 |
Fix skin issue when launching emulator from tree.
When launching the emulator with just -skin from the dev tree
the fake AVD was not using the hardware.ini config from the skin
due to creating it before resolving skinDir and skinName from the
command line options.
This change updates the AVD after doing so.
Change-Id: Ia0912d72775e26f080f763b29629a3691c253c43
Diffstat (limited to 'android')
-rw-r--r-- | android/avd/info.c | 17 | ||||
-rw-r--r-- | android/avd/info.h | 3 | ||||
-rw-r--r-- | android/main.c | 3 |
3 files changed, 21 insertions, 2 deletions
diff --git a/android/avd/info.c b/android/avd/info.c index f850f5b..3463f6a 100644 --- a/android/avd/info.c +++ b/android/avd/info.c @@ -780,12 +780,23 @@ _avdInfo_getBuildSkinHardwareIni( AvdInfo* i ) { char* skinName; char* skinDirPath; - char temp[PATH_MAX], *p=temp, *end=p+sizeof(temp); avdInfo_getSkinInfo(i, &skinName, &skinDirPath); if (skinDirPath == NULL) return 0; + int result = avdInfo_getSkinHardwareIni(i, skinName, skinDirPath); + + AFREE(skinName); + AFREE(skinDirPath); + + return result; +} + +int avdInfo_getSkinHardwareIni( AvdInfo* i, char* skinName, char* skinDirPath) +{ + char temp[PATH_MAX], *p=temp, *end=p+sizeof(temp); + p = bufprint(temp, end, "%s/%s/hardware.ini", skinDirPath, skinName); if (p >= end || !path_exists(temp)) { DD("no skin-specific hardware.ini in %s", skinDirPath); @@ -793,6 +804,8 @@ _avdInfo_getBuildSkinHardwareIni( AvdInfo* i ) } D("found skin-specific hardware.ini: %s", temp); + if (i->skinHardwareIni != NULL) + iniFile_free(i->skinHardwareIni); i->skinHardwareIni = iniFile_newFromFile(temp); if (i->skinHardwareIni == NULL) return -1; @@ -1082,7 +1095,7 @@ avdInfo_getSkinInfo( AvdInfo* i, char** pSkinName, char** pSkinDir ) /* First, see if the config.ini contains a SKIN_PATH entry that * names the full directory path for the skin. */ - if ( i->configIni != NULL ) { + if (i->configIni != NULL ) { skinPath = iniFile_getString( i->configIni, SKIN_PATH, NULL ); if (skinPath != NULL) { /* If this skin name is magic or a direct directory path diff --git a/android/avd/info.h b/android/avd/info.h index 11f4897..4388b7c 100644 --- a/android/avd/info.h +++ b/android/avd/info.h @@ -106,6 +106,9 @@ typedef struct { */ AvdInfo* avdInfo_new( const char* name, AvdInfoParams* params ); +/* Update the AvdInfo hardware config from a given skin name and path */ +int avdInfo_getSkinHardwareIni( AvdInfo* i, char* skinName, char* skinDirPath); + /* A special function used to setup an AvdInfo for use when starting * the emulator from the Android build system. In this specific instance * we're going to create temporary files to hold all writable image diff --git a/android/main.c b/android/main.c index 9a763e5..66b25c2 100644 --- a/android/main.c +++ b/android/main.c @@ -319,6 +319,9 @@ int main(int argc, char **argv) opts->skindir = skinDir; D("autoconfig: -skindir %s", opts->skindir); + + /* update the avd hw config from this new skin */ + avdInfo_getSkinHardwareIni(avd, opts->skin, opts->skindir); } /* Read hardware configuration */ |