Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f42bdac4 authored by Yifan Hong's avatar Yifan Hong Committed by android-build-merger
Browse files

Merge "libsnapshot: Allow multiple calls to FinishedSnapshotWrites" am: 09a0c985

am: ab13ed35

Change-Id: I4a3f4e4c16b5d9a83bb26b1e04bd68f58e42ab96
parents cefab586 ab13ed35
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -152,7 +152,13 @@ bool SnapshotManager::FinishedSnapshotWrites() {
    auto lock = LockExclusive();
    if (!lock) return false;

    if (ReadUpdateState(lock.get()) != UpdateState::Initiated) {
    auto update_state = ReadUpdateState(lock.get());
    if (update_state == UpdateState::Unverified) {
        LOG(INFO) << "FinishedSnapshotWrites already called before. Ignored.";
        return true;
    }

    if (update_state != UpdateState::Initiated) {
        LOG(ERROR) << "Can only transition to the Unverified state from the Initiated state.";
        return false;
    }