diff options
author | Grigory Dzhavadyan <grigoryj@google.com> | 2016-05-20 11:30:51 -0700 |
---|---|---|
committer | Yurii Zubrytskyi <zyy@google.com> | 2016-05-20 18:36:05 +0000 |
commit | 3e659ead99569b27b4d054748fbb72e3ff1bf029 (patch) | |
tree | 72a9665d8af4559131ad58853873a384dc405cf5 | |
parent | 6f4c70984b6c8dd13b0f39ec23993398a091b5e6 (diff) | |
download | qemu-android-3e659ead99569b27b4d054748fbb72e3ff1bf029.tar.gz |
Fix the 'rotate' console command
Change-Id: Id3730495b49fdf40e42f4ff7116f01046f2df213
-rw-r--r-- | android-console.c | 32 |
1 files changed, 5 insertions, 27 deletions
diff --git a/android-console.c b/android-console.c index 785cf8ae70..df57f17497 100644 --- a/android-console.c +++ b/android-console.c @@ -36,6 +36,8 @@ #include "hmp.h" #include "android/error-messages.h" +#include "android/emulator-window.h" +#include "android/skin/ui.h" #include "android/globals.h" @@ -1906,35 +1908,11 @@ void android_console_geo(Monitor* mon, const QDict* qdict) { helptext ? "OK" : "KO: missing sub-command"); } - void android_console_rotate_screen(Monitor *mon, const QDict *qdict) { - static int ranchu_rotation_state = 0; /* 0-3 */ - - ranchu_rotation_state = ((ranchu_rotation_state + 1) % 4); - - goldfish_sensors_set_rotation(ranchu_rotation_state); - /* The mapping between QEMU and Android's idea of rotation are - reversed */ - switch (ranchu_rotation_state) { - case 0: - goldfish_fb_set_rotation(0); - graphic_rotate = 0; - break; - case 1: - goldfish_fb_set_rotation(3); - graphic_rotate = 90; - break; - case 2: - goldfish_fb_set_rotation(2); - graphic_rotate = 180; - break; - case 3: - goldfish_fb_set_rotation(1); - graphic_rotate = 270; - break; - default: - g_assert_not_reached(); + EmulatorWindow* win = emulator_window_get(); + if (win) { + skin_ui_select_next_layout(win->ui); } } |