aboutsummaryrefslogtreecommitdiffstats
path: root/android/main.c
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@android.com>2011-05-19 20:51:01 +0200
committerXavier Ducrohet <xav@android.com>2011-08-05 12:27:24 -0700
commitf490aee025b3bab5bcdb065e5fc1b1abecf16b97 (patch)
treeace0400c734e32b1516cad415be4aaa6b8f9880c /android/main.c
parent97d15562536c28f5a8bb079994cc526412cf506e (diff)
downloadexternal_qemu-f490aee025b3bab5bcdb065e5fc1b1abecf16b97.zip
external_qemu-f490aee025b3bab5bcdb065e5fc1b1abecf16b97.tar.gz
external_qemu-f490aee025b3bab5bcdb065e5fc1b1abecf16b97.tar.bz2
Merge c80340 from master to r13: 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/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 ec7ea61..e71301c 100644
--- a/android/main.c
+++ b/android/main.c
@@ -1031,9 +1031,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) {