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

Commit f2b34024 authored by Hongguang Chen's avatar Hongguang Chen Committed by Automerger Merge Worker
Browse files

Merge "Add Quiescent Reboot Target" am: f156552e am: e9cab7fa am: bdbca25d

Original change: https://android-review.googlesource.com/c/platform/system/core/+/1752060

Change-Id: I492bf113bc4f3445cb9e3d79dfa0aed1309d6ced
parents 36687e3d bdbca25d
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -1035,6 +1035,20 @@ void HandlePowerctlMessage(const std::string& command) {
                        return;
                    }
                }
            } else if (reboot_target == "quiescent") {
                bootloader_message boot = {};
                if (std::string err; !read_bootloader_message(&boot, &err)) {
                    LOG(ERROR) << "Failed to read bootloader message: " << err;
                }
                // Update the boot command field if it's empty, and preserve
                // the other arguments in the bootloader message.
                if (!CommandIsPresent(&boot)) {
                    strlcpy(boot.command, "boot-quiescent", sizeof(boot.command));
                    if (std::string err; !write_bootloader_message(boot, &err)) {
                        LOG(ERROR) << "Failed to set bootloader message: " << err;
                        return;
                    }
                }
            } else if (reboot_target == "sideload" || reboot_target == "sideload-auto-reboot" ||
                       reboot_target == "fastboot") {
                std::string arg = reboot_target == "sideload-auto-reboot" ? "sideload_auto_reboot"