aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Bao2015-09-02 13:20:30 -0500
committerTao Bao2015-09-02 16:38:23 -0500
commit8e9c68019f9c284b89155c71922ad8ac84af6ab6 (patch)
treeda09d23420b358bd14eac600efaca18128a45016 /wear_ui.cpp
parent337db14f274fc73dd540aa71d2c21c431fe686ec (diff)
downloadplatform-bootable-recovery-8e9c68019f9c284b89155c71922ad8ac84af6ab6.tar.gz
platform-bootable-recovery-8e9c68019f9c284b89155c71922ad8ac84af6ab6.tar.xz
platform-bootable-recovery-8e9c68019f9c284b89155c71922ad8ac84af6ab6.zip
recovery: Fix the bug that truncates menu entries.
When there are 20 entries (like 10 last_log* and 10 last_kmg* in "view recovery logs"), there's no "Back" entry. Because the number of entries (21) exceeds text_rows (20) in WearRecoveryUI::StartMenu(). Since we have scrollable menu, having more entries than text_rows won't be an issue. Bug: 23752519 Change-Id: I12573d7a34852a1a3d130c9e88522cee737eb08f
Diffstat (limited to 'wear_ui.cpp')
-rw-r--r--wear_ui.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/wear_ui.cpp b/wear_ui.cpp
index 4ae42c46..55b7afc8 100644
--- a/wear_ui.cpp
+++ b/wear_ui.cpp
@@ -482,7 +482,12 @@ void WearRecoveryUI::StartMenu(const char* const * headers, const char* const *
482 if (text_rows > 0 && text_cols > 0) { 482 if (text_rows > 0 && text_cols > 0) {
483 menu_headers_ = headers; 483 menu_headers_ = headers;
484 size_t i = 0; 484 size_t i = 0;
485 for (; i < text_rows && items[i] != nullptr; i++) { 485 // "i < text_rows" is removed from the loop termination condition,
486 // which is different from the one in ScreenRecoveryUI::StartMenu().
487 // Because WearRecoveryUI supports scrollable menu, it's fine to have
488 // more entries than text_rows. The menu may be truncated otherwise.
489 // Bug: 23752519
490 for (; items[i] != nullptr; i++) {
486 strncpy(menu[i], items[i], text_cols - 1); 491 strncpy(menu[i], items[i], text_cols - 1);
487 menu[i][text_cols - 1] = '\0'; 492 menu[i][text_cols - 1] = '\0';
488 } 493 }