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

Commit 97f94a34 authored by David Anderson's avatar David Anderson Committed by Automerger Merge Worker
Browse files

Merge "libsnapshot: Don't call RemoveAllSnapshots on normal boot." into main...

Merge "libsnapshot: Don't call RemoveAllSnapshots on normal boot." into main am: 0bb10989 am: 58ec6d18

Original change: https://android-review.googlesource.com/c/platform/system/core/+/3508341



Change-Id: Ib37add050a9c8da546f4b8211ce58bdc28b71b8c
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 6bce5a91 58ec6d18
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -351,10 +351,15 @@ bool SnapshotManager::RemoveAllUpdateState(LockedFile* lock, const std::function

    LOG(INFO) << "Removing all update state.";

    if (ReadUpdateState(lock) != UpdateState::None) {
        // Only call this if we're actually cancelling an update. It's not
        // expected to yield anything otherwise, and firing up gsid on normal
        // boot is expensive.
        if (!RemoveAllSnapshots(lock)) {
            LOG(ERROR) << "Could not remove all snapshots";
            return false;
        }
    }

    // It's okay if these fail:
    // - For SnapshotBoot and Rollback, first-stage init performs a deeper check after