aboutsummaryrefslogtreecommitdiffstats
path: root/android/avd
diff options
context:
space:
mode:
Diffstat (limited to 'android/avd')
-rw-r--r--android/avd/hardware-properties.ini158
-rw-r--r--android/avd/hw-config.c18
-rw-r--r--android/avd/hw-config.h7
-rw-r--r--android/avd/info.c26
-rw-r--r--android/avd/info.h12
-rw-r--r--android/avd/util.c2
6 files changed, 86 insertions, 137 deletions
diff --git a/android/avd/hardware-properties.ini b/android/avd/hardware-properties.ini
index ebf2450..582083c 100644
--- a/android/avd/hardware-properties.ini
+++ b/android/avd/hardware-properties.ini
@@ -46,12 +46,13 @@ default = 0
abstract = Device ram size
description = The amount of physical RAM on the device, in megabytes.
-# Touch screen support
-name = hw.touchScreen
-type = boolean
-default = yes
-abstract = Touch-screen support
-description = Whether there is a touch screen or not on the device.
+# Touch screen type
+name = hw.screen
+type = string
+enum = touch, multi-touch, no-touch
+default = touch
+abstract = Touch screen type
+description = Defines type of the screen.
# Hardware main keys (back/home)
name = hw.mainKeys
@@ -70,7 +71,7 @@ description = Whether there is a trackball on the device.
# Keyboard support (qwerty/azerty)
name = hw.keyboard
type = boolean
-default = yes
+default = no
abstract = Keyboard support
description = Whether the device has a QWERTY keyboard.
@@ -114,23 +115,6 @@ default = yes
abstract = GSM modem support
description = Whether there is a GSM modem in the device.
-# Camera support
-name = hw.camera
-type = boolean
-default = yes
-abstract = Camera support
-description = Whether the device has a camera.
-
-name = hw.camera.maxHorizontalPixels
-type = integer
-default = 640
-abstract = Maximum horizontal camera pixels
-
-name = hw.camera.maxVerticalPixels
-type = integer
-default = 480
-abstract = Maximum vertical camera pixels
-
# GPS support
name = hw.gps
type = boolean
@@ -209,16 +193,18 @@ abstract = LCD pixel height
name = hw.lcd.depth
type = integer
+enum = 16, 32
default = 16
abstract = LCD color depth
-description = Must be 16 or 32. Color bit depth of emulated framebuffer.
+description = Color bit depth of emulated framebuffer.
# LCD density
name = hw.lcd.density
type = integer
+enum = 120, 160, 240, 213, 320
default = 160
abstract = Abstracted LCD density
-description = Must be one of 120 / 160 / 240 / 213/ 320. A value used to roughly describe the density of the LCD screen for automatic resource/asset selection.
+description = A value used to roughly describe the density of the LCD screen for automatic resource/asset selection.
# LCD backlight - Enable/Disable LCD backlight simulation
# default = no : Disabled
@@ -237,119 +223,23 @@ default = no
abstract = GPU emulation
description = Enable/Disable emulated OpenGLES GPU
-# Fake camera support
-#
-name = hw.fakeCamera
-type = string
-default = back
-abstract = Fake camera control
-description = Must be 'back', if fake camera is facing back, 'front', if fake camera is facing front, or 'off' if fake camera is disabled.
-
-# Number of emulated web cameras
-#
-name = hw.webcam.count
-type = integer
-default = 6
-abstract = Number of emulated web cameras
-description = Defines number of web cameras to emulate. 0 disables webcam emulation.
-
-# Defines name of the emulated webcam with index 0
-#
-name = hw.webcam.0.name
-type = string
-default = webcam0
-abstract = Name of the 1-st emulated web camera
-description = Emulator-generated platform-independent name identifying a camera in the list of enumerated web cameras.
-
-# Defines name of the emulated webcam with index 1
-#
-name = hw.webcam.1.name
-type = string
-default = webcam1
-abstract = Name of the 2-nd emulated web camera
-description = Emulator-generated platform-independent camera name.
-
-# Defines name of the emulated webcam with index 2
-#
-name = hw.webcam.2.name
-type = string
-default = webcam2
-abstract = Name of the 3-rd emulated web camera
-description = Emulator-generated platform-independent camera name.
-
-# Defines name of the emulated webcam with index 3
-#
-name = hw.webcam.3.name
-type = string
-default = webcam3
-abstract = Name of the 4-th emulated web camera
-description = Emulator-generated platform-independent camera name.
-
-# Defines name of the emulated webcam with index 4
-#
-name = hw.webcam.4.name
-type = string
-default = webcam4
-abstract = Name of the 5-th emulated web camera
-description = Emulator-generated platform-independent camera name.
-
-# Defines name of the emulated webcam with index 5
-#
-name = hw.webcam.5.name
-type = string
-default = webcam5
-abstract = Name of the 6-th emulated web camera
-description = Emulator-generated platform-independent camera name.
-
-# Defines direction of the emulated webcam with index 0
-#
-name = hw.webcam.0.direction
-type = string
-default = front
-abstract = 1-st emulated web camera direction
-description = Direction of the 1-st emulated web camera
-
-# Defines direction of the emulated webcam with index 1
-# Note that first two cameras must face in opposite directions in order to enable
-# camera switch in the camera application.
-#
-name = hw.webcam.1.direction
-type = string
-default = back
-abstract = 2-nd emulated web camera direction
-description = Direction of the 2-nd emulated web camera
-
-# Defines direction of the emulated webcam with index 2
-#
-name = hw.webcam.2.direction
-type = string
-default = front
-abstract = 3-rd emulated web camera direction
-description = Direction of the 3-rd emulated web camera
-
-# Defines direction of the emulated webcam with index 3
-#
-name = hw.webcam.3.direction
-type = string
-default = front
-abstract = 4-th emulated web camera direction
-description = Direction of the 4-th emulated web camera
-
-# Defines direction of the emulated webcam with index 4
+# Configures camera facing back
#
-name = hw.webcam.4.direction
+name = hw.camera.back
type = string
-default = front
-abstract = 5-th emulated web camera direction
-description = Direction of the 5-th emulated web camera
+enum = emulated, none, webcam0, ...
+default = emulated
+abstract = Configures camera facing back
+description = Must be 'emulated' for a fake camera, 'webcam<N>' for a web camera, or 'none' if back camera is disabled.
-# Defines direction of the emulated webcam with index 5
+# Configures camera facing front
#
-name = hw.webcam.5.direction
+name = hw.camera.front
type = string
-default = front
-abstract = 6-th emulated web camera direction
-description = Direction of the 6-th emulated web camera
+enum = emulated, none, webcam0, ...
+default = none
+abstract = Configures camera facing front
+description = Must be 'emulated' for a fake camera, 'webcam<N>' for a web camera, or 'none' if front camera is disabled.
# Maximum VM heap size
# Higher values are required for high-dpi devices
diff --git a/android/avd/hw-config.c b/android/avd/hw-config.c
index 65796d9..2d50ef7 100644
--- a/android/avd/hw-config.c
+++ b/android/avd/hw-config.c
@@ -125,3 +125,21 @@ androidHwConfig_done( AndroidHwConfig* config )
#include "android/avd/hw-config-defs.h"
}
+
+int
+androidHwConfig_isScreenNoTouch( AndroidHwConfig* config )
+{
+ return strcmp(config->hw_screen, "no-touch") == 0;
+}
+
+int
+androidHwConfig_isScreenTouch( AndroidHwConfig* config )
+{
+ return strcmp(config->hw_screen, "touch") == 0;
+}
+
+int
+androidHwConfig_isScreenMultiTouch( AndroidHwConfig* config )
+{
+ return strcmp(config->hw_screen, "multi-touch") == 0;
+}
diff --git a/android/avd/hw-config.h b/android/avd/hw-config.h
index 3c2480a..fd99e45 100644
--- a/android/avd/hw-config.h
+++ b/android/avd/hw-config.h
@@ -57,4 +57,11 @@ int androidHwConfig_write( AndroidHwConfig* hwConfig,
/* Finalize a given hardware configuration */
void androidHwConfig_done( AndroidHwConfig* config );
+/* Checks if screen doesn't support touch, or multi-touch */
+int androidHwConfig_isScreenNoTouch( AndroidHwConfig* config );
+/* Checks if screen supports touch (but not multi-touch). */
+int androidHwConfig_isScreenTouch( AndroidHwConfig* config );
+/* Checks if screen supports multi-touch. */
+int androidHwConfig_isScreenMultiTouch( AndroidHwConfig* config );
+
#endif /* _ANDROID_AVD_HW_CONFIG_H */
diff --git a/android/avd/info.c b/android/avd/info.c
index 7fd8cc4..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
@@ -1207,3 +1220,12 @@ int avdInfo_getAdbdCommunicationMode( AvdInfo* i )
{
return path_getAdbdCommunicationMode(i->androidOut);
}
+
+int avdInfo_getSnapshotPresent(AvdInfo* i)
+{
+ if (i->configIni == NULL) {
+ return 0;
+ } else {
+ return iniFile_getBoolean(i->configIni, "snapshot.present", "no");
+ }
+}
diff --git a/android/avd/info.h b/android/avd/info.h
index 74a9b01..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
@@ -252,6 +255,15 @@ const char* avdInfo_getCoreHwIniPath( AvdInfo* i );
*/
int avdInfo_getAdbdCommunicationMode( AvdInfo* i );
+/* Returns config.ini snapshot presense status.
+ * This routine checks if snapshots are enabled in AVD config.ini file.
+ * Return:
+ * 1 - Snapshots are enabled in AVD config.ini file.
+ * 0 - Snapshots are disabled in AVD config.ini file, of config.ini file is not
+ * found.
+*/
+int avdInfo_getSnapshotPresent(AvdInfo* i);
+
/* */
#endif /* ANDROID_AVD_INFO_H */
diff --git a/android/avd/util.c b/android/avd/util.c
index 82145b5..a174ee3 100644
--- a/android/avd/util.c
+++ b/android/avd/util.c
@@ -183,7 +183,7 @@ _getSystemProperty( const char* propFile, const char* propName )
file = fopen(propFile, "rb");
if (file == NULL) {
- D("Could not open file: %s: %s", temp, strerror(errno));
+ D("Could not open file: %s: %s", propFile, strerror(errno));
return NULL;
}