Add '/system/bin/vdc volume reset' command

It will be used during the userspace reboot to unmount all emulated
storages, which is a prerequisite to unmount+remount ext4 userdata into
checkpoint mode.

Test: adb shell /system/bin/vdc checkpoint startCheckpoint 1
Test: adb reboot userspace
Bug: 143970043
Bug: 135984674
Change-Id: I07491bc4be2f30debe21b764766c9def68548e16
This commit is contained in:
Nikita Ioffe 2019-12-02 11:48:06 +00:00
parent 6e3441a8ea
commit 7596581e9f

View file

@ -101,6 +101,8 @@ int main(int argc, char** argv) {
checkStatus(args, vold->mountDefaultEncrypted()); checkStatus(args, vold->mountDefaultEncrypted());
} else if (args[0] == "volume" && args[1] == "shutdown") { } else if (args[0] == "volume" && args[1] == "shutdown") {
checkStatus(args, vold->shutdown()); checkStatus(args, vold->shutdown());
} else if (args[0] == "volume" && args[1] == "reset") {
checkStatus(args, vold->reset());
} else if (args[0] == "cryptfs" && args[1] == "checkEncryption" && args.size() == 3) { } else if (args[0] == "cryptfs" && args[1] == "checkEncryption" && args.size() == 3) {
checkStatus(args, vold->checkEncryption(args[2])); checkStatus(args, vold->checkEncryption(args[2]));
} else if (args[0] == "cryptfs" && args[1] == "mountFstab" && args.size() == 4) { } else if (args[0] == "cryptfs" && args[1] == "mountFstab" && args.size() == 4) {
@ -111,7 +113,8 @@ int main(int argc, char** argv) {
bool supported = false; bool supported = false;
checkStatus(args, vold->supportsCheckpoint(&supported)); checkStatus(args, vold->supportsCheckpoint(&supported));
return supported ? 1 : 0; return supported ? 1 : 0;
} else if (args[0] == "checkpoint" && args[1] == "supportsBlockCheckpoint" && args.size() == 2) { } else if (args[0] == "checkpoint" && args[1] == "supportsBlockCheckpoint" &&
args.size() == 2) {
bool supported = false; bool supported = false;
checkStatus(args, vold->supportsBlockCheckpoint(&supported)); checkStatus(args, vold->supportsBlockCheckpoint(&supported));
return supported ? 1 : 0; return supported ? 1 : 0;