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

Commit f3b02fc2 authored by David Anderson's avatar David Anderson Committed by Gerrit Code Review
Browse files

Merge changes I21563564,I2afd6444

* changes:
  libsnapshot: Fix libsnapshot_fuzzer_test.
  libsnapshot: Fix checks for compression to work with new snapuserd.
parents f7eed000 00c0cb80
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -19,6 +19,8 @@
#include <fs_mgr_overlayfs.h>
#include <fs_mgr_overlayfs.h>
#include <libfiemap/image_manager.h>
#include <libfiemap/image_manager.h>


#include "utility.h"

namespace android {
namespace android {
namespace snapshot {
namespace snapshot {


@@ -143,5 +145,9 @@ android::dm::IDeviceMapper& DeviceInfo::GetDeviceMapper() {
    return android::dm::DeviceMapper::Instance();
    return android::dm::DeviceMapper::Instance();
}
}


bool DeviceInfo::UseUserspaceSnapshots() const {
    return IsUserspaceSnapshotsEnabled();
}

}  // namespace snapshot
}  // namespace snapshot
}  // namespace android
}  // namespace android
+1 −0
Original line number Original line Diff line number Diff line
@@ -41,6 +41,7 @@ class DeviceInfo final : public SnapshotManager::IDeviceInfo {
    std::unique_ptr<IImageManager> OpenImageManager() const override;
    std::unique_ptr<IImageManager> OpenImageManager() const override;
    bool IsFirstStageInit() const override;
    bool IsFirstStageInit() const override;
    android::dm::IDeviceMapper& GetDeviceMapper() override;
    android::dm::IDeviceMapper& GetDeviceMapper() override;
    bool UseUserspaceSnapshots() const override;


    void set_first_stage_init(bool value) { first_stage_init_ = value; }
    void set_first_stage_init(bool value) { first_stage_init_ = value; }


+1 −0
Original line number Original line Diff line number Diff line
@@ -34,6 +34,7 @@ class MockDeviceInfo : public SnapshotManager::IDeviceInfo {
    MOCK_METHOD(bool, IsFirstStageInit, (), (const, override));
    MOCK_METHOD(bool, IsFirstStageInit, (), (const, override));
    MOCK_METHOD(std::unique_ptr<android::fiemap::IImageManager>, OpenImageManager, (),
    MOCK_METHOD(std::unique_ptr<android::fiemap::IImageManager>, OpenImageManager, (),
                (const, override));
                (const, override));
    MOCK_METHOD(bool, UseUserspaceSnapshots, (), (const, override));
};
};


}  // namespace android::snapshot
}  // namespace android::snapshot
+1 −0
Original line number Original line Diff line number Diff line
@@ -111,6 +111,7 @@ class ISnapshotManager {
        virtual bool IsFirstStageInit() const = 0;
        virtual bool IsFirstStageInit() const = 0;
        virtual std::unique_ptr<IImageManager> OpenImageManager() const = 0;
        virtual std::unique_ptr<IImageManager> OpenImageManager() const = 0;
        virtual android::dm::IDeviceMapper& GetDeviceMapper() = 0;
        virtual android::dm::IDeviceMapper& GetDeviceMapper() = 0;
        virtual bool UseUserspaceSnapshots() const = 0;


        // Helper method for implementing OpenImageManager.
        // Helper method for implementing OpenImageManager.
        std::unique_ptr<IImageManager> OpenImageManager(const std::string& gsid_dir) const;
        std::unique_ptr<IImageManager> OpenImageManager(const std::string& gsid_dir) const;
+1 −0
Original line number Original line Diff line number Diff line
@@ -107,6 +107,7 @@ class TestDeviceInfo : public SnapshotManager::IDeviceInfo {
    }
    }


    bool IsSlotUnbootable(uint32_t slot) { return unbootable_slots_.count(slot) != 0; }
    bool IsSlotUnbootable(uint32_t slot) { return unbootable_slots_.count(slot) != 0; }
    bool UseUserspaceSnapshots() const override;


    void set_slot_suffix(const std::string& suffix) { slot_suffix_ = suffix; }
    void set_slot_suffix(const std::string& suffix) { slot_suffix_ = suffix; }
    void set_fake_super(const std::string& path) {
    void set_fake_super(const std::string& path) {
Loading