diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp index 42269fe94..01bafbd92 100644 --- a/fastboot/fastboot.cpp +++ b/fastboot/fastboot.cpp @@ -2255,7 +2255,7 @@ int FastBootTool::Main(int argc, char* argv[]) { if (args.size() == 1) { std::string reboot_target = next_arg(&args); reboot_task = std::make_unique(fp.get(), reboot_target); - } else { + } else if (!fp->skip_reboot) { reboot_task = std::make_unique(fp.get()); } if (!args.empty()) syntax_error("junk after reboot command"); @@ -2310,7 +2310,9 @@ int FastBootTool::Main(int argc, char* argv[]) { } else { do_flashall(fp.get()); } - reboot_task = std::make_unique(fp.get()); + if (!fp->skip_reboot) { + reboot_task = std::make_unique(fp.get()); + } } else if (command == "update") { bool slot_all = (slot_override == "all"); if (slot_all) { @@ -2322,7 +2324,9 @@ int FastBootTool::Main(int argc, char* argv[]) { filename = next_arg(&args); } do_update(filename.c_str(), fp.get()); - reboot_task = std::make_unique(fp.get()); + if (!fp->skip_reboot) { + reboot_task = std::make_unique(fp.get()); + } } else if (command == FB_CMD_SET_ACTIVE) { std::string slot = verify_slot(next_arg(&args), false); fb->SetActive(slot); @@ -2411,7 +2415,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));