diff options
author | Tianjie Xu <xunchang@google.com> | 2019-07-26 20:13:22 +0200 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-07-26 20:13:22 +0200 |
commit | b25d741563834aa286643044051af3873b00a0d3 (patch) | |
tree | b7bd71c01529152b1d2789bcb8358fcf6fe8f428 /recovery_ui/screen_ui.cpp | |
parent | Merge "Clean up some global variables in common.h" (diff) | |
parent | Merge "Create a new function to return the help message for menu" (diff) | |
download | android_bootable_recovery-b25d741563834aa286643044051af3873b00a0d3.tar android_bootable_recovery-b25d741563834aa286643044051af3873b00a0d3.tar.gz android_bootable_recovery-b25d741563834aa286643044051af3873b00a0d3.tar.bz2 android_bootable_recovery-b25d741563834aa286643044051af3873b00a0d3.tar.lz android_bootable_recovery-b25d741563834aa286643044051af3873b00a0d3.tar.xz android_bootable_recovery-b25d741563834aa286643044051af3873b00a0d3.tar.zst android_bootable_recovery-b25d741563834aa286643044051af3873b00a0d3.zip |
Diffstat (limited to 'recovery_ui/screen_ui.cpp')
-rw-r--r-- | recovery_ui/screen_ui.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/recovery_ui/screen_ui.cpp b/recovery_ui/screen_ui.cpp index f2af66c45..087fc0e84 100644 --- a/recovery_ui/screen_ui.cpp +++ b/recovery_ui/screen_ui.cpp @@ -673,6 +673,19 @@ void ScreenRecoveryUI::SetTitle(const std::vector<std::string>& lines) { title_lines_ = lines; } +std::vector<std::string> ScreenRecoveryUI::GetMenuHelpMessage() const { + // clang-format off + static std::vector<std::string> REGULAR_HELP{ + "Use volume up/down and power.", + }; + static std::vector<std::string> LONG_PRESS_HELP{ + "Any button cycles highlight.", + "Long-press activates.", + }; + // clang-format on + return HasThreeButtons() ? REGULAR_HELP : LONG_PRESS_HELP; +} + // Redraws everything on the screen. Does not flip pages. Should only be called with updateMutex // locked. void ScreenRecoveryUI::draw_screen_locked() { @@ -685,16 +698,7 @@ void ScreenRecoveryUI::draw_screen_locked() { gr_color(0, 0, 0, 255); gr_clear(); - // clang-format off - static std::vector<std::string> REGULAR_HELP{ - "Use volume up/down and power.", - }; - static std::vector<std::string> LONG_PRESS_HELP{ - "Any button cycles highlight.", - "Long-press activates.", - }; - // clang-format on - draw_menu_and_text_buffer_locked(HasThreeButtons() ? REGULAR_HELP : LONG_PRESS_HELP); + draw_menu_and_text_buffer_locked(GetMenuHelpMessage()); } // Draws the menu and text buffer on the screen. Should only be called with updateMutex locked. |