summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Marshall <tdm@cyngn.com>2014-11-25 12:58:22 -0800
committerTom Marshall <tdm@cyngn.com>2015-11-25 15:35:22 -0800
commita48fd33655b2d95c250f033eaf88999cfb66e8ea (patch)
treeb411193d298b62d7db9e800bb86283cac7a55f19
parent25ac7aed16183090f9797b4a9701a9d030ba904a (diff)
downloadbootable_recovery-a48fd33655b2d95c250f033eaf88999cfb66e8ea.zip
bootable_recovery-a48fd33655b2d95c250f033eaf88999cfb66e8ea.tar.gz
bootable_recovery-a48fd33655b2d95c250f033eaf88999cfb66e8ea.tar.bz2
sr: Return to main menu after selection
Change-Id: Ib6fd1904b6516a651ffaad20f66b2eaf42c31619
-rw-r--r--recovery.cpp54
1 files changed, 26 insertions, 28 deletions
diff --git a/recovery.cpp b/recovery.cpp
index 3a1fd61..d3b1aec 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -966,35 +966,33 @@ refresh:
bool wipe_cache;
int status = INSTALL_ERROR;
- for (;;) {
- int chosen = get_menu_selection(headers, menu_items, 0, 0, device);
- for (i = 0; i < n; ++i) {
- free(menu_items[i]);
- }
- if (chosen == Device::kRefresh) {
- goto refresh;
- }
- if (chosen == Device::kGoBack) {
- break;
- }
- if (chosen == item_sideload) {
- static const char* headers[] = { "ADB Sideload",
- "",
- NULL
- };
- static const char* list[] = { "Cancel sideload", NULL };
-
- start_sideload(ui, &wipe_cache, TEMPORARY_INSTALL_FILE);
- int item = get_menu_selection(headers, list, 0, 0, device);
- if (item != Device::kNoAction) {
- stop_sideload();
- }
- status = wait_sideload();
- }
- else {
- std::string id = volumes[chosen - 1].mId;
- status = apply_from_storage(device, id, &wipe_cache);
+ int chosen = get_menu_selection(headers, menu_items, 0, 0, device);
+ for (i = 0; i < n; ++i) {
+ free(menu_items[i]);
+ }
+ if (chosen == Device::kRefresh) {
+ goto refresh;
+ }
+ if (chosen == Device::kGoBack) {
+ return INSTALL_NONE;
+ }
+ if (chosen == item_sideload) {
+ static const char* headers[] = { "ADB Sideload",
+ "",
+ NULL
+ };
+ static const char* list[] = { "Cancel sideload", NULL };
+
+ start_sideload(ui, &wipe_cache, TEMPORARY_INSTALL_FILE);
+ int item = get_menu_selection(headers, list, 0, 0, device);
+ if (item != Device::kNoAction) {
+ stop_sideload();
}
+ status = wait_sideload();
+ }
+ else {
+ std::string id = volumes[chosen - 1].mId;
+ status = apply_from_storage(device, id, &wipe_cache);
}
return status;