aboutsummaryrefslogtreecommitdiffstats
path: root/android/main.c
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@android.com>2011-07-06 18:20:03 -0700
committerAndroid Code Review <code-review@android.com>2011-07-06 18:20:03 -0700
commit89329b3c3afc7f2c441b59cbf0658e6c8f688fea (patch)
tree9828bdc85e8a86b1f94a10a4291c2d3d70abfff9 /android/main.c
parentd02b30ee5bfc925dd8e031c193c17672e500fd18 (diff)
parentc803400d45535925fb35c373e2d610fde522c546 (diff)
downloadexternal_qemu-89329b3c3afc7f2c441b59cbf0658e6c8f688fea.zip
external_qemu-89329b3c3afc7f2c441b59cbf0658e6c8f688fea.tar.gz
external_qemu-89329b3c3afc7f2c441b59cbf0658e6c8f688fea.tar.bz2
Merge "Move charmap to hardware properties"
Diffstat (limited to 'android/main.c')
-rw-r--r--android/main.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/android/main.c b/android/main.c
index 29fc079..cd3fd08 100644
--- a/android/main.c
+++ b/android/main.c
@@ -1032,9 +1032,30 @@ int main(int argc, char **argv)
args[n++] = opts->http_proxy;
}
+ if (!opts->charmap) {
+ /* Try to find a valid charmap name */
+ char* charmap = avdInfo_getCharmapFile(avd, hw->hw_keyboard_charmap);
+ if (charmap != NULL) {
+ D("autoconfig: -charmap %s", charmap);
+ opts->charmap = charmap;
+ }
+ }
+
if (opts->charmap) {
- args[n++] = "-charmap";
- args[n++] = opts->charmap;
+ char charmap_name[AKEYCHARMAP_NAME_SIZE];
+
+ if (!path_exists(opts->charmap)) {
+ derror("Charmap file does not exist: %s", opts->charmap);
+ exit(1);
+ }
+ /* We need to store the charmap name in the hardware configuration.
+ * However, the charmap file itself is only used by the UI component
+ * and doesn't need to be set to the emulation engine.
+ */
+ kcm_extract_charmap_name(opts->charmap, charmap_name,
+ sizeof(charmap_name));
+ AFREE(hw->hw_keyboard_charmap);
+ hw->hw_keyboard_charmap = ASTRDUP(charmap_name);
}
if (opts->memcheck) {