From d421038e869d70573d4f27a1a2c5cff74e107fcd Mon Sep 17 00:00:00 2001 From: SahilSonar Date: Sat, 10 Feb 2024 11:20:17 +0530 Subject: [PATCH] Revert "recovery: Ask to reboot before installing anything after A/B update" This reverts commit 107dfac7c0d7fd7cad6e7d41368d8878ea9ba2b0. --- install/install.cpp | 20 -------------------- recovery.cpp | 6 ------ 2 files changed, 26 deletions(-) diff --git a/install/install.cpp b/install/install.cpp index 979616dcf..6c62975b6 100644 --- a/install/install.cpp +++ b/install/install.cpp @@ -63,7 +63,6 @@ using namespace std::chrono_literals; -bool ask_to_ab_reboot(Device* device); bool ask_to_continue_unverified(Device* device); bool ask_to_continue_downgrade(Device* device); @@ -385,21 +384,6 @@ static InstallResult TryUpdateBinary(Package* package, bool* wipe_cache, return INSTALL_ERROR; } - const auto reboot_to_recovery = [] { - if (std::string err; !clear_bootloader_message(&err)) { - LOG(ERROR) << "Failed to clear BCB message: " << err; - } - Reboot("recovery"); - }; - - static bool ab_package_installed = false; - if (ab_package_installed) { - if (ask_to_ab_reboot(device)) { - reboot_to_recovery(); - } - return INSTALL_ERROR; - } - if (package_is_ab) { CHECK(package->GetType() == PackageType::kFile); } @@ -585,11 +569,7 @@ static InstallResult TryUpdateBinary(Package* package, bool* wipe_cache, LOG(FATAL) << "Invalid status code " << status; } if (package_is_ab) { - ab_package_installed = true; PerformPowerwashIfRequired(zip, device); - if (!ui->IsSideloadAutoReboot() && ask_to_ab_reboot(device)) { - reboot_to_recovery(); - } } return INSTALL_SUCCESS; diff --git a/recovery.cpp b/recovery.cpp index 929ef43b5..b56a81f0b 100644 --- a/recovery.cpp +++ b/recovery.cpp @@ -175,12 +175,6 @@ static bool yes_no(Device* device, const char* question1, const char* question2) return (chosen_item == 1); } -bool ask_to_ab_reboot(Device* device) { - device->GetUI()->SetProgressType(RecoveryUI::EMPTY); - return yes_no(device, "To install additional packages, you need to reboot recovery first", - "Do you want to reboot to recovery now?"); -} - bool ask_to_continue_unverified(Device* device) { if (get_build_type() == "user") { return false; -- GitLab