diff options
author | Xavier Ducrohet <xav@android.com> | 2011-08-11 18:47:27 -0700 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2011-08-22 11:10:50 -0700 |
commit | 72d561178e62b74923cfe3bc0faa59bcb07c57c3 (patch) | |
tree | 73281ee53a1af78289200a49b9ce9d180c9c59ad /android/main.c | |
parent | 34ddd725dd424c4ad487d223feb0f38f13b10779 (diff) | |
download | external_qemu-72d561178e62b74923cfe3bc0faa59bcb07c57c3.zip external_qemu-72d561178e62b74923cfe3bc0faa59bcb07c57c3.tar.gz external_qemu-72d561178e62b74923cfe3bc0faa59bcb07c57c3.tar.bz2 |
Revert "Revert "Merge c80340 from master to r13: Move charmap to hardware properties"..."
This reverts commit cccd28ca5064a7bd14282cd774ee5bb7126d5845.
c80340 add a CL to tools_r13 that broken the build. It was therefore reverted
with cccd28. This revert was merged into tools_r13 but shouldn't have been.
This reverts the revert to put back the CL in master.
Change-Id: I95fcefedb77596cfdf76269f248b2ae80c85c830
Diffstat (limited to 'android/main.c')
-rw-r--r-- | android/main.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/android/main.c b/android/main.c index 814d2ec..f20ea7b 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) { |