diff --git a/install/install.cpp b/install/install.cpp index f4486c5d..c0151ca4 100644 --- a/install/install.cpp +++ b/install/install.cpp @@ -622,7 +622,7 @@ static InstallResult TryUpdateBinary(Package* package, bool* wipe_cache, if (package_is_ab) { ab_package_installed = true; PerformPowerwashIfRequired(zip, device); - if (ask_to_ab_reboot(device)) { + if (!ui->IsSideloadAutoReboot() && ask_to_ab_reboot(device)) { reboot_to_recovery(); } } diff --git a/recovery.cpp b/recovery.cpp index c65375ec..e212e83e 100644 --- a/recovery.cpp +++ b/recovery.cpp @@ -858,6 +858,7 @@ Device::BuiltinAction start_recovery(Device* device, const std::vectorShowText(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) { diff --git a/recovery_ui/include/recovery_ui/ui.h b/recovery_ui/include/recovery_ui/ui.h index c3bb03f3..140461c7 100644 --- a/recovery_ui/include/recovery_ui/ui.h +++ b/recovery_ui/include/recovery_ui/ui.h @@ -198,6 +198,14 @@ class RecoveryUI { virtual bool IsUsbConnected(); + bool IsSideloadAutoReboot() const { + return sideload_auto_reboot_; + } + + void SetSideloadAutoReboot(bool sar) { + sideload_auto_reboot_ = sar; + } + protected: void EnqueueKey(int key_code); @@ -214,6 +222,8 @@ class RecoveryUI { bool fastbootd_logo_enabled_; + bool sideload_auto_reboot_; + private: enum class ScreensaverState { DISABLED, diff --git a/recovery_ui/ui.cpp b/recovery_ui/ui.cpp index 9b0fd94c..092ba2b5 100644 --- a/recovery_ui/ui.cpp +++ b/recovery_ui/ui.cpp @@ -69,6 +69,7 @@ RecoveryUI::RecoveryUI() DEFAULT_MAX_BRIGHTNESS_FILE)), touch_screen_allowed_(false), 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",