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
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
index b977e31..4e4f431 100644
--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -2247,7 +2247,7 @@
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 @@
} 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 @@
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 @@
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));