Change abortChanges to take a message and bool
abortChanges will attempt to pass a reboot message, and will only reboot
if the device is currently checkpointing. Additionally, it can opt to
attempt to prevent future attempts. This only works for non-bootloader
controlled updates. Failures are ignored, as it will always reboot the
device. In the unlikely event of such a failure, the device will
continue to retry as though you did not ask to prevent future attempts.
Test: vdc checkpoint abortChanges abort_retry_test 1
vdc checkpoint abortChanges abort_noretry_test 0
Change-Id: I7b6214765a1faaf4fd193c73331696b53ae572d2
diff --git a/vdc.cpp b/vdc.cpp
index 1ec46c8..76eca3e 100644
--- a/vdc.cpp
+++ b/vdc.cpp
@@ -141,8 +141,10 @@
checkStatus(vold->restoreCheckpointPart(args[2], count));
} else if (args[0] == "checkpoint" && args[1] == "markBootAttempt" && args.size() == 2) {
checkStatus(vold->markBootAttempt());
- } else if (args[0] == "checkpoint" && args[1] == "abortChanges" && args.size() == 2) {
- checkStatus(vold->abortChanges());
+ } else if (args[0] == "checkpoint" && args[1] == "abortChanges" && args.size() == 4) {
+ int retry;
+ if (!android::base::ParseInt(args[2], &retry)) exit(EINVAL);
+ checkStatus(vold->abortChanges(args[2], retry != 0));
} else {
LOG(ERROR) << "Raw commands are no longer supported";
exit(EINVAL);