vold: implement resetCheckpoint
It will be used by userspace reboot to reset checkpoint state, to make
sure that when /data is remounted, it will be remounted in checkpointing
if a checkpoint was requested beforee userspace reboot.
Test: /system/bin/vdc startCheckpoint 1
/system/bin/vdc needsCheckpoint (returns 0)
/system/bin/vdc resetCheckpoint
/system/bin/vdc needsCheckpoint (returns 1)
Bug: 135984674
Change-Id: Ia29238686289b4eed93e2fb936a8b3d894b94dc9
diff --git a/vdc.cpp b/vdc.cpp
index 839e70e..c1b7781 100644
--- a/vdc.cpp
+++ b/vdc.cpp
@@ -147,6 +147,8 @@
int retry;
if (!android::base::ParseInt(args[2], &retry)) exit(EINVAL);
checkStatus(args, vold->abortChanges(args[2], retry != 0));
+ } else if (args[0] == "checkpoint" && args[1] == "resetCheckpoint") {
+ checkStatus(args, vold->resetCheckpoint());
} else {
LOG(ERROR) << "Raw commands are no longer supported";
exit(EINVAL);