summaryrefslogtreecommitdiffstats
path: root/device.cpp
diff options
context:
space:
mode:
authorAlex Deymo <deymo@google.com>2016-08-12 21:23:47 +0200
committerandroid-build-merger <android-build-merger@google.com>2016-08-12 21:23:47 +0200
commit606724d7ad03ea75b3d0e145ca1302e773a7f1ca (patch)
treed3389cbe84c26077cccfd63a6060937d7a84f2e7 /device.cpp
parentMerge "Handle error from fopen_path in finish_recovery" am: 8a4333f3b9 am: a550ee0df7 am: b33a6f8342 (diff)
parentresolve merge conflicts of 66940b9 to nyc-mr1-dev-plus-aosp (diff)
downloadandroid_bootable_recovery-606724d7ad03ea75b3d0e145ca1302e773a7f1ca.tar
android_bootable_recovery-606724d7ad03ea75b3d0e145ca1302e773a7f1ca.tar.gz
android_bootable_recovery-606724d7ad03ea75b3d0e145ca1302e773a7f1ca.tar.bz2
android_bootable_recovery-606724d7ad03ea75b3d0e145ca1302e773a7f1ca.tar.lz
android_bootable_recovery-606724d7ad03ea75b3d0e145ca1302e773a7f1ca.tar.xz
android_bootable_recovery-606724d7ad03ea75b3d0e145ca1302e773a7f1ca.tar.zst
android_bootable_recovery-606724d7ad03ea75b3d0e145ca1302e773a7f1ca.zip
Diffstat (limited to 'device.cpp')
-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;