diff --git a/Checkpoint.cpp b/Checkpoint.cpp index 1833733..8f86174 100644 --- a/Checkpoint.cpp +++ b/Checkpoint.cpp @@ -66,7 +66,7 @@ bool setBowState(std::string const& block_device, std::string const& state) { bool cp_startCheckpoint(int retry) { if (retry < -1) return false; - std::string content = std::to_string(retry); + std::string content = std::to_string(retry + 1); if (retry == -1) { sp module = IBootControl::getService(); if (module) { @@ -136,7 +136,7 @@ bool cp_needsRollback() { return false; } -bool cp_needsCheckpoint(void) { +bool cp_needsCheckpoint() { bool ret; std::string content; sp module = IBootControl::getService(); @@ -148,7 +148,7 @@ bool cp_needsCheckpoint(void) { return false; } -bool cp_prepareDriveForCheckpoint(const std::string&) { +bool cp_prepareCheckpoint() { auto fstab_default = std::unique_ptr{ fs_mgr_read_fstab_default(), fs_mgr_free_fstab}; if (!fstab_default) return false; diff --git a/Checkpoint.h b/Checkpoint.h index 54574a7..f3554cc 100644 --- a/Checkpoint.h +++ b/Checkpoint.h @@ -32,7 +32,7 @@ bool cp_needsRollback(); bool cp_needsCheckpoint(); -bool cp_prepareDriveForCheckpoint(const std::string& mountPoint); +bool cp_prepareCheckpoint(); bool cp_restoreCheckpoint(const std::string& mountPoint); diff --git a/VoldNativeService.cpp b/VoldNativeService.cpp index 3884875..4a9ed5b 100644 --- a/VoldNativeService.cpp +++ b/VoldNativeService.cpp @@ -797,13 +797,11 @@ binder::Status VoldNativeService::commitChanges(bool* _aidl_return) { return ok(); } -binder::Status VoldNativeService::prepareDriveForCheckpoint(const std::string& mountPoint, - bool* _aidl_return) { +binder::Status VoldNativeService::prepareCheckpoint(bool* _aidl_return) { ENFORCE_UID(AID_SYSTEM); - CHECK_ARGUMENT_PATH(mountPoint); ACQUIRE_LOCK; - *_aidl_return = cp_prepareDriveForCheckpoint(mountPoint); + *_aidl_return = cp_prepareCheckpoint(); return ok(); } diff --git a/VoldNativeService.h b/VoldNativeService.h index 594c002..3bc07b6 100644 --- a/VoldNativeService.h +++ b/VoldNativeService.h @@ -118,7 +118,7 @@ class VoldNativeService : public BinderService, public os::Bn binder::Status needsCheckpoint(bool* _aidl_return); binder::Status needsRollback(bool* _aidl_return); binder::Status commitChanges(bool* _aidl_return); - binder::Status prepareDriveForCheckpoint(const std::string& mountPoint, bool* _aidl_return); + binder::Status prepareCheckpoint(bool* _aidl_return); binder::Status restoreCheckpoint(const std::string& mountPoint, bool* _aidl_return); binder::Status markBootAttempt(bool* __aidl_return); binder::Status abortChanges(); diff --git a/binder/android/os/IVold.aidl b/binder/android/os/IVold.aidl index 27330fe..c95d5ad 100644 --- a/binder/android/os/IVold.aidl +++ b/binder/android/os/IVold.aidl @@ -101,7 +101,7 @@ interface IVold { boolean needsRollback(); void abortChanges(); boolean commitChanges(); - boolean prepareDriveForCheckpoint(@utf8InCpp String mountPoint); + boolean prepareCheckpoint(); boolean restoreCheckpoint(@utf8InCpp String device); boolean markBootAttempt(); diff --git a/vdc.cpp b/vdc.cpp index 5e2c37a..6efd72c 100644 --- a/vdc.cpp +++ b/vdc.cpp @@ -123,10 +123,9 @@ int main(int argc, char** argv) { bool success = false; checkStatus(vold->commitChanges(&success)); return success ? 1 : 0; - } else if (args[0] == "checkpoint" && args[1] == "prepareDriveForCheckpoint" && - args.size() == 3) { + } else if (args[0] == "checkpoint" && args[1] == "prepareCheckpoint" && args.size() == 2) { bool success = false; - checkStatus(vold->prepareDriveForCheckpoint(args[2], &success)); + checkStatus(vold->prepareCheckpoint(&success)); return success ? 1 : 0; } else if (args[0] == "checkpoint" && args[1] == "restoreCheckpoint" && args.size() == 3) { bool success = false;