aboutsummaryrefslogtreecommitdiffstats
path: root/android/avd
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@android.com>2011-05-19 20:51:01 +0200
committerDavid 'Digit' Turner <digit@android.com>2011-07-07 00:57:08 +0200
commitc803400d45535925fb35c373e2d610fde522c546 (patch)
tree9828bdc85e8a86b1f94a10a4291c2d3d70abfff9 /android/avd
parentd02b30ee5bfc925dd8e031c193c17672e500fd18 (diff)
downloadexternal_qemu-c803400d45535925fb35c373e2d610fde522c546.zip
external_qemu-c803400d45535925fb35c373e2d610fde522c546.tar.gz
external_qemu-c803400d45535925fb35c373e2d610fde522c546.tar.bz2
Move charmap to hardware properties
The name of the emulated charmap must be passed to the guest kernel because it is used by the guest input handling code to load the proper charmap files from the system partition. This mandates that the name becomes a hardware property for the sake of supporting proper snapshotting and ui/core separation. From now on, the charmap name found in a skin will be ignored completely. This shouldn't be a problem in practice because all skins used the default name (qwerty2) anyway. The only reason to change the default value would be if emulating a guest system image that depends on a different charmap during emulation. Change-Id: If571684000b159ae9e9849661c9ff18e19b4cc75
Diffstat (limited to 'android/avd')
-rw-r--r--android/avd/hardware-properties.ini12
-rw-r--r--android/avd/info.c19
-rw-r--r--android/avd/info.h6
3 files changed, 37 insertions, 0 deletions
diff --git a/android/avd/hardware-properties.ini b/android/avd/hardware-properties.ini
index dabf166..0e650bb 100644
--- a/android/avd/hardware-properties.ini
+++ b/android/avd/hardware-properties.ini
@@ -83,6 +83,18 @@ default = yes
abstract = Keyboard lid support
description = Whether the QWERTY keyboard can be opened/closed.
+# The name of the hardware charmap for this device.
+#
+# NOTE: This should always be the default 'qwerty2' unless you have
+# modified the system image accordingly. This name is sent to
+# the kernel at boot time. Using an incorrect name will result
+# in an unusable machine.
+name = hw.keyboard.charmap
+type = string
+default = qwerty2
+abstract = Keyboard charmap name
+description = Name of the system keyboard charmap file.
+
# DPad keys
name = hw.dPad
type = boolean
diff --git a/android/avd/info.c b/android/avd/info.c
index f1514f2..7e4f93e 100644
--- a/android/avd/info.c
+++ b/android/avd/info.c
@@ -1183,3 +1183,22 @@ avdInfo_getSkinInfo( AvdInfo* i, char** pSkinName, char** pSkinDir )
AFREE(skinPath);
return;
}
+
+char*
+avdInfo_getCharmapFile( AvdInfo* i, const char* charmapName )
+{
+ char fileNameBuff[PATH_MAX];
+ const char* fileName;
+
+ if (charmapName == NULL || charmapName[0] == '\0')
+ return NULL;
+
+ if (strstr(charmapName, ".kcm") == NULL) {
+ snprintf(fileNameBuff, sizeof fileNameBuff, "%s.kcm", charmapName);
+ fileName = fileNameBuff;
+ } else {
+ fileName = charmapName;
+ }
+
+ return _avdInfo_getContentOrSdkFilePath(i, fileName);
+}
diff --git a/android/avd/info.h b/android/avd/info.h
index 5192bb9..34997b4 100644
--- a/android/avd/info.h
+++ b/android/avd/info.h
@@ -215,6 +215,12 @@ const char* avdInfo_getContentPath( AvdInfo* i );
*/
void avdInfo_getSkinInfo( AvdInfo* i, char** pSkinName, char** pSkinDir );
+/* Find a charmap file named <charmapName>.kcm for this AVD.
+ * Returns the path of the file on success, or NULL if not found.
+ * The result string must be freed by the caller.
+ */
+char* avdInfo_getCharmapFile( AvdInfo* i, const char* charmapName );
+
/* Returns TRUE iff in the Android build system */
int avdInfo_inAndroidBuild( AvdInfo* i );