Correcting Reboot Task Functionality

Modifying fastboot-info.txt to directly call reboot fastboot instead of
reboot userspace -> so no longer need "userspace" in reboot task. Also
moving skip_reboot check to task since in old code we can have
skip_reboot be true and still reboot to bootloader, fastboot, or
recovery

Test: tested reboot commands on Raven
Change-Id: I98ba51747bf7229a88ba737540c81d20b42e5981
This commit is contained in:
Daniel Zheng 2023-03-13 18:13:08 +00:00
parent bd85a18d0b
commit 1418fb8ce0

View file

@ -2247,7 +2247,7 @@ int FastBootTool::Main(int argc, char* argv[]) {
if (args.size() == 1) {
std::string reboot_target = next_arg(&args);
reboot_task = std::make_unique<RebootTask>(fp.get(), reboot_target);
} else {
} else if (!fp->skip_reboot) {
reboot_task = std::make_unique<RebootTask>(fp.get());
}
if (!args.empty()) syntax_error("junk after reboot command");
@ -2302,7 +2302,9 @@ int FastBootTool::Main(int argc, char* argv[]) {
} else {
do_flashall(fp.get());
}
reboot_task = std::make_unique<RebootTask>(fp.get());
if (!fp->skip_reboot) {
reboot_task = std::make_unique<RebootTask>(fp.get());
}
} else if (command == "update") {
bool slot_all = (slot_override == "all");
if (slot_all) {
@ -2314,7 +2316,9 @@ int FastBootTool::Main(int argc, char* argv[]) {
filename = next_arg(&args);
}
do_update(filename.c_str(), fp.get());
reboot_task = std::make_unique<RebootTask>(fp.get());
if (!fp->skip_reboot) {
reboot_task = std::make_unique<RebootTask>(fp.get());
}
} else if (command == FB_CMD_SET_ACTIVE) {
std::string slot = verify_slot(next_arg(&args), false);
fb->SetActive(slot);
@ -2403,7 +2407,7 @@ int FastBootTool::Main(int argc, char* argv[]) {
if (fp->wants_set_active) {
fb->SetActive(next_active);
}
if (reboot_task && !fp->skip_reboot) {
if (reboot_task) {
reboot_task->Run();
}
fprintf(stderr, "Finished. Total time: %.3fs\n", (now() - start));