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

Commit 99944810 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

am: f42bdac4

Change-Id: Iabfaceac9ec5032d452859d1eb958a669998322d
parents 5c1d6861 f42bdac4
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;
    }