aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes2015-03-20 20:22:15 -0500
committerElliott Hughes2015-03-22 20:16:31 -0500
commitc51ac89f0ee5d4a0dd8edebc134a924f83738140 (patch)
tree0fd31cd73e5dc9ae3160612e58b5570a2b884b67 /default_device.cpp
parent8c637903fedafd0acdc3906f42032f2e88cd1f7f (diff)
downloadplatform-bootable-recovery-c51ac89f0ee5d4a0dd8edebc134a924f83738140.tar.gz
platform-bootable-recovery-c51ac89f0ee5d4a0dd8edebc134a924f83738140.tar.xz
platform-bootable-recovery-c51ac89f0ee5d4a0dd8edebc134a924f83738140.zip
Add "Apply update from sdcard" to default recovery image.
At the moment, this is the only difference in the sprout recovery image. That's silly. Let's just improve the error handling slightly and always have this option present. Also make the obscure "<3e>" less unclear. Also use "power button" as the default text rather than "enter button", because it's been years since anyone had one of those. (Longer term we should let subclassers tell us the keycode and we translate it to the correct string.) Also move the two "Reboot" options together, put "Power off" at the bottom (and use that terminology, like the real UI, rather than "Power down"), and use capitals throughout. Finally, add a README.md with some useful instructions. Change-Id: I94fb19f73d79c54fed2dda30cefb884426641b5c
Diffstat (limited to 'default_device.cpp')
-rw-r--r--default_device.cpp40
1 files changed, 23 insertions, 17 deletions
diff --git a/default_device.cpp b/default_device.cpp
index 97806ac5..ed601f6c 100644
--- a/default_device.cpp
+++ b/default_device.cpp
@@ -20,19 +20,24 @@
20#include "device.h" 20#include "device.h"
21#include "screen_ui.h" 21#include "screen_ui.h"
22 22
23static const char* HEADERS[] = { "Volume up/down to move highlight;", 23static const char* HEADERS[] = {
24 "enter button to select.", 24 "Volume up/down to move highlight.",
25 "", 25 "Power button to select.",
26 NULL }; 26 "",
27 NULL
28};
27 29
28static const char* ITEMS[] = {"reboot system now", 30static const char* ITEMS[] = {
29 "apply update from ADB", 31 "Reboot system now",
30 "wipe data/factory reset", 32 "Reboot to bootloader",
31 "wipe cache partition", 33 "Apply update from ADB",
32 "reboot to bootloader", 34 "Apply update from SD card",
33 "power down", 35 "Wipe data/factory reset",
34 "view recovery logs", 36 "Wipe cache partition",
35 NULL }; 37 "View recovery logs",
38 "Power off",
39 NULL
40};
36 41
37class DefaultDevice : public Device { 42class DefaultDevice : public Device {
38 public: 43 public:
@@ -65,12 +70,13 @@ class DefaultDevice : public Device {
65 BuiltinAction InvokeMenuItem(int menu_position) { 70 BuiltinAction InvokeMenuItem(int menu_position) {
66 switch (menu_position) { 71 switch (menu_position) {
67 case 0: return REBOOT; 72 case 0: return REBOOT;
68 case 1: return APPLY_ADB_SIDELOAD; 73 case 1: return REBOOT_BOOTLOADER;
69 case 2: return WIPE_DATA; 74 case 2: return APPLY_ADB_SIDELOAD;
70 case 3: return WIPE_CACHE; 75 case 3: return APPLY_EXT;
71 case 4: return REBOOT_BOOTLOADER; 76 case 4: return WIPE_DATA;
72 case 5: return SHUTDOWN; 77 case 5: return WIPE_CACHE;
73 case 6: return READ_RECOVERY_LASTLOG; 78 case 6: return READ_RECOVERY_LASTLOG;
79 case 7: return SHUTDOWN;
74 default: return NO_ACTION; 80 default: return NO_ACTION;
75 } 81 }
76 } 82 }