diff options
author | Koushik Dutta <koushd@gmail.com> | 2010-12-18 17:42:31 -0800 |
---|---|---|
committer | Koushik Dutta <koushd@gmail.com> | 2010-12-18 17:42:31 -0800 |
commit | df1e4067821353af7a006ef4d70b7001ad3bd924 (patch) | |
tree | 874fd5be1d93fb75610bf1d14925799934127977 /default_recovery_ui.c | |
parent | 5d6309e77f6055a9aec062dd991d071054726ebb (diff) | |
parent | 0b7bbf29d5864fc2939ab9b954c0e1d18a24bffd (diff) | |
download | bootable_recovery-df1e4067821353af7a006ef4d70b7001ad3bd924.zip bootable_recovery-df1e4067821353af7a006ef4d70b7001ad3bd924.tar.gz bootable_recovery-df1e4067821353af7a006ef4d70b7001ad3bd924.tar.bz2 |
Merge from ClockworkMod recovery
Change-Id: Id5b312147173ced559a62d97029acede6c2f8766
Diffstat (limited to 'default_recovery_ui.c')
-rw-r--r-- | default_recovery_ui.c | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/default_recovery_ui.c b/default_recovery_ui.c index ce12787..9c192a2 100644 --- a/default_recovery_ui.c +++ b/default_recovery_ui.c @@ -18,15 +18,18 @@ #include "recovery_ui.h" #include "common.h" +#include "extendedcommands.h" -char* MENU_HEADERS[] = { "Android system recovery utility", - "", - NULL }; +char* MENU_HEADERS[] = { NULL }; char* MENU_ITEMS[] = { "reboot system now", "apply update from sdcard", "wipe data/factory reset", "wipe cache partition", + "install zip from sdcard", + "backup and restore", + "mounts and storage", + "advanced", NULL }; int device_recovery_start() { @@ -34,7 +37,14 @@ int device_recovery_start() { } int device_toggle_display(volatile char* key_pressed, int key_code) { - return key_code == KEY_HOME; + int alt = key_pressed[KEY_LEFTALT] || key_pressed[KEY_RIGHTALT]; + if (alt && key_code == KEY_L) + return 1; + // allow toggling of the display if the correct key is pressed, and the display toggle is allowed or the display is currently off + if (ui_get_showing_back_button()) { + return get_allow_toggle_display() && (key_code == KEY_HOME || key_code == KEY_MENU || key_code == KEY_END); + } + return get_allow_toggle_display() && (key_code == KEY_HOME || key_code == KEY_MENU || key_code == KEY_POWER || key_code == KEY_END); } int device_reboot_now(volatile char* key_pressed, int key_code) { @@ -44,16 +54,37 @@ int device_reboot_now(volatile char* key_pressed, int key_code) { int device_handle_key(int key_code, int visible) { if (visible) { switch (key_code) { + case KEY_CAPSLOCK: case KEY_DOWN: case KEY_VOLUMEDOWN: return HIGHLIGHT_DOWN; + case KEY_LEFTSHIFT: case KEY_UP: case KEY_VOLUMEUP: return HIGHLIGHT_UP; + case KEY_POWER: + if (ui_get_showing_back_button()) { + return SELECT_ITEM; + } + if (!get_allow_toggle_display()) + return GO_BACK; + break; + case KEY_LEFTBRACE: case KEY_ENTER: + case BTN_MOUSE: + case KEY_CENTER: + case KEY_CAMERA: + case KEY_F21: + case KEY_SEND: return SELECT_ITEM; + + case KEY_END: + case KEY_BACKSPACE: + case KEY_BACK: + if (!get_allow_toggle_display()) + return GO_BACK; } } |