summaryrefslogtreecommitdiffstats
path: root/screen_ui.h
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2018-05-01 22:32:37 +0200
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-05-01 22:32:37 +0200
commitcac3ec3513050b3835e059dd540cfad74a60e1c8 (patch)
tree03eda9404b106cff6d8186940355c7b957ec0ea2 /screen_ui.h
parentMerge "updater_sample: add FileDownloader" (diff)
parentAdd ScreenRecoveryUI::ShowMenu(). (diff)
downloadandroid_bootable_recovery-cac3ec3513050b3835e059dd540cfad74a60e1c8.tar
android_bootable_recovery-cac3ec3513050b3835e059dd540cfad74a60e1c8.tar.gz
android_bootable_recovery-cac3ec3513050b3835e059dd540cfad74a60e1c8.tar.bz2
android_bootable_recovery-cac3ec3513050b3835e059dd540cfad74a60e1c8.tar.lz
android_bootable_recovery-cac3ec3513050b3835e059dd540cfad74a60e1c8.tar.xz
android_bootable_recovery-cac3ec3513050b3835e059dd540cfad74a60e1c8.tar.zst
android_bootable_recovery-cac3ec3513050b3835e059dd540cfad74a60e1c8.zip
Diffstat (limited to 'screen_ui.h')
-rw-r--r--screen_ui.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/screen_ui.h b/screen_ui.h
index c1222a576..837d346a2 100644
--- a/screen_ui.h
+++ b/screen_ui.h
@@ -20,6 +20,7 @@
#include <pthread.h>
#include <stdio.h>
+#include <functional>
#include <memory>
#include <string>
#include <vector>
@@ -135,10 +136,8 @@ class ScreenRecoveryUI : public RecoveryUI {
void ShowFile(const char* filename) override;
// menu display
- void StartMenu(const char* const* headers, const char* const* items,
- int initial_selection) override;
- int SelectMenu(int sel) override;
- void EndMenu() override;
+ int ShowMenu(const char* const* headers, const char* const* items, int initial_selection,
+ bool menu_only, const std::function<int(int, bool)>& key_handler) override;
void KeyLongPress(int) override;
@@ -164,6 +163,18 @@ class ScreenRecoveryUI : public RecoveryUI {
virtual bool InitTextParams();
+ // Displays some header text followed by a menu of items, which appears at the top of the screen
+ // (in place of any scrolling ui_print() output, if necessary).
+ virtual void StartMenu(const char* const* headers, const char* const* items,
+ int initial_selection);
+
+ // Sets the menu highlight to the given index, wrapping if necessary. Returns the actual item
+ // selected.
+ virtual int SelectMenu(int sel);
+
+ // Ends menu mode, resetting the text overlay so that ui_print() statements will be displayed.
+ virtual void EndMenu();
+
virtual void draw_background_locked();
virtual void draw_foreground_locked();
virtual void draw_screen_locked();