diff options
Diffstat (limited to 'android')
-rw-r--r-- | android/avd/info.c | 17 | ||||
-rw-r--r-- | android/avd/info.h | 3 | ||||
-rw-r--r-- | android/help.c | 18 | ||||
-rw-r--r-- | android/main.c | 5 |
4 files changed, 32 insertions, 11 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/help.c b/android/help.c index 20758c0..c6ffb87 100644 --- a/android/help.c +++ b/android/help.c @@ -1432,12 +1432,12 @@ static void help_gpu(stralloc_t* out) { PRINTF( - " Use -gpu <mode> to force the mode of hardware OpenGLES emulation.\n" - " Valid values for <mode> are:\n\n" + " Use -gpu <mode> to override the mode of hardware OpenGL ES emulation\n" + " indicated by the AVD. Valid values for <mode> are:\n\n" " on -> enable GPU emulation\n" " off -> disable GPU emulation\n" - " auto -> automatic detection\n" + " auto -> use the setting from the AVD\n" " enabled -> same as 'on'\n" " disabled -> same as 'off'\n\n" @@ -1448,11 +1448,13 @@ help_gpu(stralloc_t* out) " force the virtual device to use the slow software renderer instead.\n" " Note that OpenGLES 2.0 is _not_ supported by it.\n\n" - " The 'auto' mode is the default. It will only enable GPU emulation if the\n" - " virtual device supports it, and the host-side OpenGLES emulation library\n" - " could be properly initialized (this can fail when you run the emulator\n" - " under certain restricted environments where the program can't access the\n" - " graphics sub-system (e.g. head-less servers).\n" + " The 'auto' mode is the default. In this mode, the hw.gpu.enabled setting\n" + " in the AVD's hardware-qemu.ini file will determine whether GPU emulation\n" + " is enabled.\n\n" + + " Even if hardware GPU emulation is enabled, if the host-side OpenGL ES\n" + " emulation library cannot be initialized, the emulator will run with GPU\n" + " emulation disabled rather than failing to start.\n" ); } diff --git a/android/main.c b/android/main.c index 9a763e5..51d481c 100644 --- a/android/main.c +++ b/android/main.c @@ -176,7 +176,7 @@ int main(int argc, char **argv) AConfig* skinConfig; char* skinPath; int inAndroidBuild; - uint64_t defaultPartitionSize = convertMBToBytes(128); + uint64_t defaultPartitionSize = convertMBToBytes(200); AndroidOptions opts[1]; /* net.shared_net_ip boot property value. */ @@ -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 */ |