Merge "Handle retry count"

This commit is contained in:
Treehugger Robot 2018-10-16 01:25:34 +00:00 committed by Gerrit Code Review
commit e74587af4d
6 changed files with 10 additions and 13 deletions

View file

@ -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<IBootControl> 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<IBootControl> 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<fstab, decltype(&fs_mgr_free_fstab)>{
fs_mgr_read_fstab_default(), fs_mgr_free_fstab};
if (!fstab_default) return false;

View file

@ -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);

View file

@ -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();
}

View file

@ -118,7 +118,7 @@ class VoldNativeService : public BinderService<VoldNativeService>, 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();

View file

@ -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();

View file

@ -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;