Merge "Handle retry count" am: e74587af4d

am: e1e3dc3698

Change-Id: I22e6a5ca7502bec0d12b443652dd5c9c7a6b546b
gugelfrei
Daniel Rosenberg 6 years ago committed by android-build-merger
commit c879ec2005

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

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

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

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

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

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

Loading…
Cancel
Save