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

Commit 5155a5f7 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "libsnapshot: Print current slot during rollback" into main

parents 150d445d a611672a
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -2496,17 +2496,20 @@ bool SnapshotManager::NeedSnapshotsInFirstStageMount() {
        if (slot == Slot::Source) {
            // Device is rebooting into the original slot, so mark this as a
            // rollback.
            auto contents = ReadUpdateSourceSlotSuffix();
            auto path = GetRollbackIndicatorPath();
            if (!android::base::WriteStringToFile("1", path)) {
                PLOG(ERROR) << "Unable to write rollback indicator: " << path;
            } else {
                LOG(INFO) << "Rollback detected, writing rollback indicator to " << path;
                LOG(INFO) << "Rollback detected, writing rollback indicator to " << path
                          << ". UpdateSourceSlot: " << contents;
                if (device_->IsTempMetadata()) {
                    CleanupScratchOtaMetadataIfPresent();
                }
            }
        }
        LOG(INFO) << "Not booting from new slot. Will not mount snapshots.";
        LOG(INFO) << "Not booting from new slot: " << device_->GetSlotSuffix()
                  << ". Will not mount snapshots.";
        return false;
    }