summaryrefslogtreecommitdiffstats
path: root/device.cpp
diff options
context:
space:
mode:
authorAlex Deymo <deymo@google.com>2016-08-04 06:03:53 +0200
committerAlex Deymo <deymo@google.com>2016-08-12 03:55:11 +0200
commit4344d636d4f8687054593f88ddd7509ff8581419 (patch)
tree649779ffef3d413eadb67d85419056c1d9ef4752 /device.cpp
parentImport translations. DO NOT MERGE (diff)
downloadandroid_bootable_recovery-4344d636d4f8687054593f88ddd7509ff8581419.tar
android_bootable_recovery-4344d636d4f8687054593f88ddd7509ff8581419.tar.gz
android_bootable_recovery-4344d636d4f8687054593f88ddd7509ff8581419.tar.bz2
android_bootable_recovery-4344d636d4f8687054593f88ddd7509ff8581419.tar.lz
android_bootable_recovery-4344d636d4f8687054593f88ddd7509ff8581419.tar.xz
android_bootable_recovery-4344d636d4f8687054593f88ddd7509ff8581419.tar.zst
android_bootable_recovery-4344d636d4f8687054593f88ddd7509ff8581419.zip
Diffstat (limited to '')
-rw-r--r--device.cpp32
1 files changed, 8 insertions, 24 deletions
diff --git a/device.cpp b/device.cpp
index f8fbb8a49..e717dddf7 100644
--- a/device.cpp
+++ b/device.cpp
@@ -16,36 +16,15 @@
#include "device.h"
-#if defined(AB_OTA_UPDATER)
-
-static const char* MENU_ITEMS[] = {
- "Reboot system now",
- "Reboot to bootloader",
- "Wipe data/factory reset",
- "Mount /system",
- "Run graphics test",
- "Power off",
- NULL,
-};
-
-static const Device::BuiltinAction MENU_ACTIONS[] = {
- Device::REBOOT,
- Device::REBOOT_BOOTLOADER,
- Device::WIPE_DATA,
- Device::MOUNT_SYSTEM,
- Device::RUN_GRAPHICS_TEST,
- Device::SHUTDOWN,
-};
-
-#else
-
static const char* MENU_ITEMS[] = {
"Reboot system now",
"Reboot to bootloader",
"Apply update from ADB",
"Apply update from SD card",
"Wipe data/factory reset",
+#ifndef AB_OTA_UPDATER
"Wipe cache partition",
+#endif // !AB_OTA_UPDATER
"Mount /system",
"View recovery logs",
"Run graphics test",
@@ -59,14 +38,19 @@ static const Device::BuiltinAction MENU_ACTIONS[] = {
Device::APPLY_ADB_SIDELOAD,
Device::APPLY_SDCARD,
Device::WIPE_DATA,
+#ifndef AB_OTA_UPDATER
Device::WIPE_CACHE,
+#endif // !AB_OTA_UPDATER
Device::MOUNT_SYSTEM,
Device::VIEW_RECOVERY_LOGS,
Device::RUN_GRAPHICS_TEST,
Device::SHUTDOWN,
};
-#endif
+static_assert(sizeof(MENU_ITEMS) / sizeof(MENU_ITEMS[0]) ==
+ sizeof(MENU_ACTIONS) / sizeof(MENU_ACTIONS[0]) + 1,
+ "MENU_ITEMS and MENU_ACTIONS should have the same length, "
+ "except for the extra NULL entry in MENU_ITEMS.");
const char* const* Device::GetMenuItems() {
return MENU_ITEMS;