From 1fe1afe863fde957051774cf2d9936c314d342a2 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Tue, 1 May 2018 15:56:05 -0700 Subject: Move menu headers/items to std::vector. Test: mmma -j bootable/recovery Test: Run recovery_unit_test on marlin. Test: Build and boot into recovery image on angler. Check the UI that shows menu ('View recovery log', 'Wipe data', 'Run locale test'). Test: Start recovery with '--prompt_and_wipe_data'. Check the UI. Change-Id: If8a4209e0bb4ca64f719f9f9465d3b3589a69cdc --- ui.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'ui.h') diff --git a/ui.h b/ui.h index c4689923a..35cc36e70 100644 --- a/ui.h +++ b/ui.h @@ -23,6 +23,7 @@ #include #include +#include // Abstract class for controlling the user interface during recovery. class RecoveryUI { @@ -139,10 +140,11 @@ class RecoveryUI { // key_handler, which may be beyond the range of menu items. This could be used to trigger a // device-specific action, even without that being listed in the menu. Caller needs to handle // such a case accordingly (e.g. by calling Device::InvokeMenuItem() to process the action). - // Returns a non-negative value (the chosen item number or device-specific action code), or -1 if - // timed out waiting for input. - virtual int ShowMenu(const char* const* headers, const char* const* items, int initial_selection, - bool menu_only, const std::function& key_handler) = 0; + // Returns a non-negative value (the chosen item number or device-specific action code), or + // static_cast(-1) if timed out waiting for input. + virtual size_t ShowMenu(const std::vector& headers, + const std::vector& items, size_t initial_selection, + bool menu_only, const std::function& key_handler) = 0; protected: void EnqueueKey(int key_code); -- cgit v1.2.3