diff options
author | Tom Marshall <tdm@cyngn.com> | 2015-12-08 16:24:35 -0800 |
---|---|---|
committer | Tom Marshall <tdm@cyngn.com> | 2016-02-04 13:22:50 -0800 |
commit | da584a2e6df7045c080aceca9d3a8a3fee0081db (patch) | |
tree | e60eea5963892e48c4b089f23dc115edbad011bf /device.h | |
parent | 3b963ad1b26694ae891f5f3a6ca0c569dbd71945 (diff) | |
download | bootable_recovery-da584a2e6df7045c080aceca9d3a8a3fee0081db.zip bootable_recovery-da584a2e6df7045c080aceca9d3a8a3fee0081db.tar.gz bootable_recovery-da584a2e6df7045c080aceca9d3a8a3fee0081db.tar.bz2 |
recovery: Menu rewrites and cleanups
* Introduce a menu stack for navigating sub-menus. The menu data
structure format is a bit messy, but necessary in order to provide
a string list for the ui.
* Create "advanced" sub-menu for rarely used and dangerous commands.
* Create "factory reset" sub-menu for various reset and wipe commands.
* Separate "wipe data" and "factory reset" items.
Change-Id: Ib9bc6967b98d022880cfe7fa8e324cd64b07d248
Diffstat (limited to 'device.h')
-rw-r--r-- | device.h | 31 |
1 files changed, 18 insertions, 13 deletions
@@ -19,11 +19,15 @@ #include "ui.h" +#include <stack> + #define KEY_FLAG_ABS 0x8000 +struct menu; + class Device : public VoldWatcher { public: - Device(RecoveryUI* ui) : ui_(ui) { } + explicit Device(RecoveryUI* ui); virtual ~Device() { } // Called to obtain the UI object that should be used to display @@ -59,18 +63,17 @@ class Device : public VoldWatcher { virtual int HandleMenuKey(int key, int visible); enum BuiltinAction { - NO_ACTION = 0, - REBOOT = 1, - APPLY_UPDATE = 2, - // APPLY_CACHE was 3. - // APPLY_ADB_SIDELOAD was 4. - WIPE_DATA = 5, - WIPE_CACHE = 6, - WIPE_MEDIA = 7, - REBOOT_BOOTLOADER = 8, - SHUTDOWN = 9, - VIEW_RECOVERY_LOGS = 10, - MOUNT_SYSTEM = 11, + NO_ACTION, + REBOOT, + APPLY_UPDATE, + WIPE_DATA, + WIPE_FULL, + WIPE_CACHE, + REBOOT_RECOVERY, + REBOOT_BOOTLOADER, + SHUTDOWN, + VIEW_RECOVERY_LOGS, + MOUNT_SYSTEM, }; // Return the list of menu items (an array of strings, @@ -117,6 +120,8 @@ class Device : public VoldWatcher { private: RecoveryUI* ui_; + + std::stack<const menu*> menu_stack; }; // The device-specific library must define this function (or the |