recovery: Don't consider manual install aborts as errors

* From android-11, recovery warns the user about the danger of
   rebooting after a failed update, but if we didn't even start
   the install procedure it doesn't really make much sense.

Change-Id: Ifaf5eae9fe6e1d915a035e2570c22260de59f99b
This commit is contained in:
Alessandro Astone 2020-10-04 21:59:52 +02:00 committed by zlewchan
parent 36c90b36d3
commit 8d038450d7
3 changed files with 6 additions and 3 deletions

View file

@ -347,7 +347,7 @@ InstallResult ApplyFromAdb(Device* device, bool rescue_mode, Device::BuiltinActi
RecoveryUI* ui = device->GetUI();
InstallResult install_result = INSTALL_ERROR;
InstallResult install_result = INSTALL_NONE;
std::map<MinadbdCommand, CommandFunction> command_map{
{ MinadbdCommand::kInstall, std::bind(&AdbInstallPackageHandler, device, &install_result) },
{ MinadbdCommand::kRebootAndroid, std::bind(&AdbRebootHandler, MinadbdCommand::kRebootAndroid,

View file

@ -209,14 +209,14 @@ InstallResult ApplyFromSdcard(Device* device) {
auto ui = device->GetUI();
if (ensure_path_mounted(SDCARD_ROOT) != 0) {
LOG(ERROR) << "\n-- Couldn't mount " << SDCARD_ROOT << ".\n";
return INSTALL_ERROR;
return INSTALL_NONE;
}
std::string path = BrowseDirectory(SDCARD_ROOT, device, ui);
if (path.empty()) {
LOG(ERROR) << "\n-- No package file selected.\n";
ensure_path_unmounted(SDCARD_ROOT);
return INSTALL_ERROR;
return INSTALL_NONE;
}
// Hint the install function to read from a block map file.

View file

@ -480,6 +480,9 @@ static Device::BuiltinAction PromptAndWait(Device* device, InstallResult status)
if (status == INSTALL_REBOOT) {
return reboot_action;
}
if (status == INSTALL_NONE) {
update_in_progress = false;
}
if (status == INSTALL_SUCCESS) {
update_in_progress = false;