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

Commit 71ab9dbe authored by David Anderson's avatar David Anderson
Browse files

libsnapshot: Do not attempt compression features in recovery.

Test: adb sideload
Change-Id: Ic69fc2f5c37a5d4fc0fcd0819ebf58e0249f7773
parent ad7d1d13
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -2130,10 +2130,6 @@ bool SnapshotManager::UnmapCowDevices(LockedFile* lock, const std::string& name)
bool SnapshotManager::UnmapDmUserDevice(const std::string& snapshot_name) {
    auto& dm = DeviceMapper::Instance();

    if (!EnsureSnapuserdConnected()) {
        return false;
    }

    auto dm_user_name = GetDmUserCowName(snapshot_name);
    if (dm.GetState(dm_user_name) == DmDeviceState::INVALID) {
        return true;
@@ -2144,6 +2140,9 @@ bool SnapshotManager::UnmapDmUserDevice(const std::string& snapshot_name) {
        return false;
    }

    if (!EnsureSnapuserdConnected()) {
        return false;
    }
    if (!snapuserd_client_->WaitForDeviceDelete(dm_user_name)) {
        LOG(ERROR) << "Failed to wait for " << dm_user_name << " control device to delete";
        return false;
@@ -2585,8 +2584,9 @@ Return SnapshotManager::CreateUpdateSnapshots(const DeltaArchiveManifest& manife
    // these devices.
    AutoDeviceList created_devices;

    bool use_compression =
            IsCompressionEnabled() && manifest.dynamic_partition_metadata().vabc_enabled();
    bool use_compression = IsCompressionEnabled() &&
                           manifest.dynamic_partition_metadata().vabc_enabled() &&
                           !device_->IsRecovery();

    PartitionCowCreator cow_creator{
            .target_metadata = target_metadata.get(),