Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f2351afa authored by Sahil Sonar's avatar Sahil Sonar 💬 Committed by Nishith Khanna
Browse files

Revert "recovery: Ask to reboot before installing anything after A/B update"

This reverts commit 107dfac7.
parent 90a3481a
Loading
Loading
Loading
Loading
+0 −20
Original line number Diff line number Diff line
@@ -64,7 +64,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);

@@ -419,21 +418,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);
  }
@@ -619,11 +603,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;
+0 −6
Original line number Diff line number Diff line
@@ -171,12 +171,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;