summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Mertz <scott@cyngn.com>2016-02-24 14:59:29 -0800
committerScott Mertz <scott@cyngn.com>2016-02-24 15:32:39 -0800
commitd66f66eb72fc72c17d1a292cfbeaf2ec08721327 (patch)
tree6981f9b25d9aee1044086a5222779a62e65ae9a6
parent49879342bc3ba7b7db7721678334c9aaf14dccbf (diff)
downloadbootable_recovery-d66f66eb72fc72c17d1a292cfbeaf2ec08721327.zip
bootable_recovery-d66f66eb72fc72c17d1a292cfbeaf2ec08721327.tar.gz
bootable_recovery-d66f66eb72fc72c17d1a292cfbeaf2ec08721327.tar.bz2
recovery: handle back button when navigating recovery logs
Fixes the crash when a user presses a hardware back button instead of the on screen menu item. OPO-521 Change-Id: I579d2720cdf7256a269358d037582121425d7c25
-rw-r--r--recovery.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/recovery.cpp b/recovery.cpp
index 7ddc645..35c6830 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -936,7 +936,8 @@ static void choose_recovery_file(Device* device) {
while (true) {
int chosen_item = get_menu_selection(headers, entries, 1, 0, device);
- if (strcmp(entries[chosen_item], "Back") == 0) break;
+ if (chosen_item == Device::kGoBack) break;
+ if (chosen_item >= 0 && strcmp(entries[chosen_item], "Back") == 0) break;
ui->ShowFile(entries[chosen_item]);
}