Changed FlashTask and RebootTask to take in FlashingPlan
Test: tested flash {partition} on raven and reboot {target} on raven
Change-Id: I26f4723474c3a142b086c1ac361578f8487ec3b9
Bug: 194686221
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
index e2e734e..ffd0411 100644
--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -2277,6 +2277,7 @@
fastboot::FastBootDriver fastboot_driver(transport, driver_callbacks, false);
fb = &fastboot_driver;
+ fp->fb = &fastboot_driver;
const double start = now();
@@ -2352,17 +2353,17 @@
} else if (command == FB_CMD_REBOOT) {
if (args.size() == 1) {
std::string reboot_target = next_arg(&args);
- reboot_task = std::make_unique<RebootTask>(fb, reboot_target);
+ reboot_task = std::make_unique<RebootTask>(fp.get(), reboot_target);
} else {
- reboot_task = std::make_unique<RebootTask>(fb);
+ reboot_task = std::make_unique<RebootTask>(fp.get());
}
if (!args.empty()) syntax_error("junk after reboot command");
} else if (command == FB_CMD_REBOOT_BOOTLOADER) {
- reboot_task = std::make_unique<RebootTask>(fb, "bootloader");
+ reboot_task = std::make_unique<RebootTask>(fp.get(), "bootloader");
} else if (command == FB_CMD_REBOOT_RECOVERY) {
- reboot_task = std::make_unique<RebootTask>(fb, "recovery");
+ reboot_task = std::make_unique<RebootTask>(fp.get(), "recovery");
} else if (command == FB_CMD_REBOOT_FASTBOOT) {
- reboot_task = std::make_unique<RebootTask>(fb, "fastboot");
+ reboot_task = std::make_unique<RebootTask>(fp.get(), "fastboot");
} else if (command == FB_CMD_CONTINUE) {
fb->Continue();
} else if (command == FB_CMD_BOOT) {
@@ -2383,7 +2384,7 @@
fname = find_item(pname);
}
if (fname.empty()) die("cannot determine image filename for '%s'", pname.c_str());
- FlashTask task(slot_override, fp->force_flash, pname, fname);
+ FlashTask task(slot_override, pname, fname);
task.Run();
} else if (command == "flash:raw") {
std::string partition = next_arg(&args);
@@ -2407,7 +2408,7 @@
} else {
do_flashall(fp.get());
}
- reboot_task = std::make_unique<RebootTask>(fb);
+ reboot_task = std::make_unique<RebootTask>(fp.get());
} else if (command == "update") {
bool slot_all = (slot_override == "all");
if (slot_all) {
@@ -2419,7 +2420,7 @@
filename = next_arg(&args);
}
do_update(filename.c_str(), fp.get());
- reboot_task = std::make_unique<RebootTask>(fb);
+ 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);