diff options
-rw-r--r-- | recovery.cpp | 54 |
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; |