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

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

Merge "libsnapshot: Allow multiple calls to FinishedSnapshotWrites" am:...

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

Change-Id: I293798e5927f04bc645caed89d3eac75bcc6c43f
parents 1d6106a6 99944810
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;
    }