diff options
author | Yifan Hong <elsk@google.com> | 2020-02-20 17:09:55 -0800 |
---|---|---|
committer | Yifan Hong <elsk@google.com> | 2020-03-03 13:19:49 -0800 |
commit | 7fd9b8b7f36a84dafc9150a45ccd20bf11dae9f5 (patch) | |
tree | 3e249e8f4472adde331eb0fbe252e921ab695618 | |
parent | 61870306526a8cc3de64abb31f259bb80ea0f4ed (diff) |
libsnapshot: NeedSnapshotsInFirstStageMount don't test for IsRecovery
Init skips first stage mount entirely in recovery, so
the check is useless. Also, __ANDROID_RECOVERY__ is always
set for first stage init.
Also add logs if rollback indicator is set.
Fixes: 149956852
Test: apply OTA, manually rollback, reboot, see rollback indicator
Change-Id: Iac967baf4b51ea5ce9f6eb962a33cb7ee5819c1d
-rw-r--r-- | fs_mgr/libsnapshot/snapshot.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs_mgr/libsnapshot/snapshot.cpp b/fs_mgr/libsnapshot/snapshot.cpp index aeec17bcd..2ffd777a2 100644 --- a/fs_mgr/libsnapshot/snapshot.cpp +++ b/fs_mgr/libsnapshot/snapshot.cpp @@ -1387,12 +1387,14 @@ bool SnapshotManager::NeedSnapshotsInFirstStageMount() { auto slot = GetCurrentSlot(); if (slot != Slot::Target) { - if (slot == Slot::Source && !device_->IsRecovery()) { + if (slot == Slot::Source) { // Device is rebooting into the original slot, so mark this as a // rollback. 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) << "Not booting from new slot. Will not mount snapshots."; |