diff options
author | Elliott Hughes | 2016-05-23 19:43:41 -0500 |
---|---|---|
committer | Elliott Hughes | 2016-05-23 19:44:50 -0500 |
commit | 01fcbe160bd49891c0680b80c5688cd4feb2adbc (patch) | |
tree | f2f6c428f7b751fe2e589bbe73d7d77f9777a738 | |
parent | 3aabd770d916019d0656bbcd8b102a4033a26a38 (diff) | |
download | platform-bootable-recovery-01fcbe160bd49891c0680b80c5688cd4feb2adbc.tar.gz platform-bootable-recovery-01fcbe160bd49891c0680b80c5688cd4feb2adbc.tar.xz platform-bootable-recovery-01fcbe160bd49891c0680b80c5688cd4feb2adbc.zip |
Disable the meaningless parts of the UI for A/B.
Bug: http://b/28748484
Change-Id: Ie86a265f4699503471e7c717d65677a916dbd25b
-rw-r--r-- | Android.mk | 4 | ||||
-rw-r--r-- | device.cpp | 54 |
2 files changed, 44 insertions, 14 deletions
@@ -93,6 +93,10 @@ ifeq ($(TARGET_USERIMAGES_USE_EXT4), true) | |||
93 | LOCAL_STATIC_LIBRARIES += libext4_utils_static libz | 93 | LOCAL_STATIC_LIBRARIES += libext4_utils_static libz |
94 | endif | 94 | endif |
95 | 95 | ||
96 | ifeq ($(AB_OTA_UPDATER),true) | ||
97 | LOCAL_CFLAGS += -DAB_OTA_UPDATER=1 | ||
98 | endif | ||
99 | |||
96 | LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin | 100 | LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin |
97 | 101 | ||
98 | ifeq ($(TARGET_RECOVERY_UI_LIB),) | 102 | ifeq ($(TARGET_RECOVERY_UI_LIB),) |
@@ -16,6 +16,29 @@ | |||
16 | 16 | ||
17 | #include "device.h" | 17 | #include "device.h" |
18 | 18 | ||
19 | #if defined(AB_OTA_UPDATER) | ||
20 | |||
21 | static const char* MENU_ITEMS[] = { | ||
22 | "Reboot system now", | ||
23 | "Reboot to bootloader", | ||
24 | "Wipe data/factory reset", | ||
25 | "Mount /system", | ||
26 | "Run graphics test", | ||
27 | "Power off", | ||
28 | NULL, | ||
29 | }; | ||
30 | |||
31 | static const Device::BuiltinAction MENU_ACTIONS[] = { | ||
32 | Device::REBOOT, | ||
33 | Device::REBOOT_BOOTLOADER, | ||
34 | Device::WIPE_DATA, | ||
35 | Device::MOUNT_SYSTEM, | ||
36 | Device::RUN_GRAPHICS_TEST, | ||
37 | Device::SHUTDOWN, | ||
38 | }; | ||
39 | |||
40 | #else | ||
41 | |||
19 | static const char* MENU_ITEMS[] = { | 42 | static const char* MENU_ITEMS[] = { |
20 | "Reboot system now", | 43 | "Reboot system now", |
21 | "Reboot to bootloader", | 44 | "Reboot to bootloader", |
@@ -27,27 +50,30 @@ static const char* MENU_ITEMS[] = { | |||
27 | "View recovery logs", | 50 | "View recovery logs", |
28 | "Run graphics test", | 51 | "Run graphics test", |
29 | "Power off", | 52 | "Power off", |
30 | NULL | 53 | NULL, |
31 | }; | 54 | }; |
32 | 55 | ||
56 | static const Device::BuiltinAction MENU_ACTIONS[] = { | ||
57 | Device::REBOOT, | ||
58 | Device::REBOOT_BOOTLOADER, | ||
59 | Device::APPLY_ADB_SIDELOAD, | ||
60 | Device::APPLY_SDCARD, | ||
61 | Device::WIPE_DATA, | ||
62 | Device::WIPE_CACHE, | ||
63 | Device::MOUNT_SYSTEM, | ||
64 | Device::VIEW_RECOVERY_LOGS, | ||
65 | Device::RUN_GRAPHICS_TEST, | ||
66 | Device::SHUTDOWN, | ||
67 | }; | ||
68 | |||
69 | #endif | ||
70 | |||
33 | const char* const* Device::GetMenuItems() { | 71 | const char* const* Device::GetMenuItems() { |
34 | return MENU_ITEMS; | 72 | return MENU_ITEMS; |
35 | } | 73 | } |
36 | 74 | ||
37 | Device::BuiltinAction Device::InvokeMenuItem(int menu_position) { | 75 | Device::BuiltinAction Device::InvokeMenuItem(int menu_position) { |
38 | switch (menu_position) { | 76 | return menu_position < 0 ? NO_ACTION : MENU_ACTIONS[menu_position]; |
39 | case 0: return REBOOT; | ||
40 | case 1: return REBOOT_BOOTLOADER; | ||
41 | case 2: return APPLY_ADB_SIDELOAD; | ||
42 | case 3: return APPLY_SDCARD; | ||
43 | case 4: return WIPE_DATA; | ||
44 | case 5: return WIPE_CACHE; | ||
45 | case 6: return MOUNT_SYSTEM; | ||
46 | case 7: return VIEW_RECOVERY_LOGS; | ||
47 | case 8: return RUN_GRAPHICS_TEST; | ||
48 | case 9: return SHUTDOWN; | ||
49 | default: return NO_ACTION; | ||
50 | } | ||
51 | } | 77 | } |
52 | 78 | ||
53 | int Device::HandleMenuKey(int key, int visible) { | 79 | int Device::HandleMenuKey(int key, int visible) { |