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

Commit bbb50753 authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

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

This reverts commit a11e95ff.

Revert "recovery: Bypass reboot prompt for sideload-auto-reboot"

This reverts commit b27281fb.

Revert "recovery: Simplify reboot recovery reason"

This reverts commit ae8668f9.

Revert "recovery: Clear BCB before rebooting to recovery"

This reverts commit d8a97bcc.
parent d6afd9f1
Loading
Loading
Loading
Loading
+0 −21
Original line number Diff line number Diff line
@@ -46,7 +46,6 @@
#include <android-base/strings.h>
#include <android-base/unique_fd.h>

#include "bootloader_message/bootloader_message.h"
#include "install/snapshot_utils.h"
#include "install/spl_check.h"
#include "install/wipe_data.h"
@@ -64,7 +63,6 @@

using namespace std::chrono_literals;

bool ask_to_ab_reboot(Device* device);
bool ask_to_cancel_ota(Device* device);
bool ask_to_continue_unverified(Device* device);
bool ask_to_continue_downgrade(Device* device);
@@ -449,21 +447,6 @@ static InstallResult TryUpdateBinary(Package* package, bool* wipe_cache,
    spl_downgrade_approved = true;
  }

  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);
  }
@@ -649,11 +632,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 −7
Original line number Diff line number Diff line
@@ -172,12 +172,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;
@@ -1015,7 +1009,6 @@ Device::BuiltinAction start_recovery(Device* device, const std::vector<std::stri
    if (!sideload_auto_reboot) {
      ui->ShowText(true);
    }
    ui->SetSideloadAutoReboot(sideload_auto_reboot);
    status = ApplyFromAdb(device, false /* rescue_mode */, &next_action);
    ui->Print("\nInstall from ADB complete (status: %d).\n", status);
    if (sideload_auto_reboot) {
+0 −10
Original line number Diff line number Diff line
@@ -301,14 +301,6 @@ class RecoveryUI {
    EnqueueKey(KEY_REFRESH);
  }

  bool IsSideloadAutoReboot() const {
    return sideload_auto_reboot_;
  }

  void SetSideloadAutoReboot(bool sar) {
    sideload_auto_reboot_ = sar;
  }

 protected:
  void EnqueueKey(int key_code);
  void EnqueueTouch(const Point& pos);
@@ -326,8 +318,6 @@ class RecoveryUI {

  bool fastbootd_logo_enabled_;

  bool sideload_auto_reboot_;

 private:
  enum class ScreensaverState {
    DISABLED,
+0 −1
Original line number Diff line number Diff line
@@ -70,7 +70,6 @@ RecoveryUI::RecoveryUI()
                                                      DEFAULT_MAX_BRIGHTNESS_FILE)),
      touch_screen_allowed_(true),
      fastbootd_logo_enabled_(false),
      sideload_auto_reboot_(false),
      touch_low_threshold_(android::base::GetIntProperty("ro.recovery.ui.touch_low_threshold",
                                                         kDefaultTouchLowThreshold)),
      touch_high_threshold_(android::base::GetIntProperty("ro.recovery.ui.touch_high_threshold",