From 137943d31b10ab2ec821b34bba7fc7a43961aa1b Mon Sep 17 00:00:00 2001 From: Tianjie Xu Date: Thu, 18 Jul 2019 18:00:33 +0000 Subject: [PATCH] Revert "init: Write the reason in BCB on "reboot recovery"" This reverts commit 4d35f2e59c7c599c4e9935714f3b18d58ef47b4f. Reason for revert: b/137523800 This breaks factory reset on all devices (and potentially rescue party and non-ab updates). Because the init code unconditionally clear the arguments like "--wipe_data" written by framework; as a result, device boots into recovery without doing wipe. I guess one fix is to check the content of BCB, and skip the overwrite if it already boots into recovery. Revert the cl first to unblock p1, will submit the fix separately. Change-Id: Iccaf3dce6999005c2199490a138844d5a5d99e7f --- init/reboot.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/init/reboot.cpp b/init/reboot.cpp index cb54d3488..0e6134809 100644 --- a/init/reboot.cpp +++ b/init/reboot.cpp @@ -669,13 +669,6 @@ bool HandlePowerctlMessage(const std::string& command) { "bootloader_message: " << err; } - } else if (reboot_target == "recovery") { - const std::vector options = {}; - std::string err; - if (!write_bootloader_message(options, &err)) { - LOG(ERROR) << "Failed to set bootloader message: " << err; - return false; - } } else if (reboot_target == "sideload" || reboot_target == "sideload-auto-reboot" || reboot_target == "fastboot") { std::string arg = reboot_target == "sideload-auto-reboot" ? "sideload_auto_reboot"