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

Commit 216ce098 authored by Tianjie Xu's avatar Tianjie Xu Committed by Gerrit Code Review
Browse files

Merge changes from topic "revert-1433573-vab-libsnapshot-linkage-APIHERUSEB"

* changes:
  Revert "libsnapshot: Partially implement OpenSnapshotWriter."
  Revert "libsnapshot: Implement OnlineKernelSnapshotWriter::OpenReader."
parents a560b76f 5aa52d91
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -147,7 +147,6 @@ cc_binary {
    static_libs: [
        "libgtest_prod",
        "libhealthhalutils",
        "libsnapshot_cow",
        "libsnapshot_nobinder",
        "update_metadata-protos",
    ],
+0 −5
Original line number Diff line number Diff line
@@ -74,11 +74,9 @@ filegroup {
        "android/snapshot/snapshot.proto",
        "device_info.cpp",
        "snapshot.cpp",
        "snapshot_reader.cpp",
        "snapshot_stats.cpp",
        "snapshot_stub.cpp",
        "snapshot_metadata_updater.cpp",
        "snapshot_writer.cpp",
        "partition_cow_creator.cpp",
        "return.cpp",
        "utility.cpp",
@@ -249,7 +247,6 @@ cc_defaults {
        "libgmock",
        "liblp",
        "libsnapshot",
        "libsnapshot_cow",
        "libsnapshot_test_helpers",
        "libsparse",
    ],
@@ -284,7 +281,6 @@ cc_binary {
    static_libs: [
        "libfstab",
        "libsnapshot",
        "libsnapshot_cow",
        "update_metadata-protos",
    ],
    shared_libs: [
@@ -348,7 +344,6 @@ cc_defaults {
        "libgmock", // from libsnapshot_test_helpers
        "liblog",
        "liblp",
        "libsnapshot_cow",
        "libsnapshot_test_helpers",
        "libprotobuf-mutator",
    ],
+3 −6
Original line number Diff line number Diff line
@@ -32,9 +32,6 @@ namespace snapshot {

static_assert(sizeof(off_t) == sizeof(uint64_t));

using android::base::borrowed_fd;
using android::base::unique_fd;

bool ICowWriter::AddCopy(uint64_t new_block, uint64_t old_block) {
    if (!ValidateNewBlock(new_block)) {
        return false;
@@ -101,12 +98,12 @@ bool CowWriter::ParseOptions() {
    return true;
}

bool CowWriter::Initialize(unique_fd&& fd, OpenMode mode) {
bool CowWriter::Initialize(android::base::unique_fd&& fd, OpenMode mode) {
    owned_fd_ = std::move(fd);
    return Initialize(borrowed_fd{owned_fd_}, mode);
    return Initialize(android::base::borrowed_fd{owned_fd_}, mode);
}

bool CowWriter::Initialize(borrowed_fd fd, OpenMode mode) {
bool CowWriter::Initialize(android::base::borrowed_fd fd, OpenMode mode) {
    fd_ = fd;

    if (!ParseOptions()) {
+0 −3
Original line number Diff line number Diff line
@@ -58,9 +58,6 @@ class ICowWriter {
    // Return number of bytes the cow image occupies on disk.
    virtual uint64_t GetCowSize() = 0;

    // Returns true if AddCopy() operations are supported.
    virtual bool SupportsCopyOperation() const { return true; }

    const CowOptions& options() { return options_; }

  protected:
+3 −1
Original line number Diff line number Diff line
@@ -38,7 +38,9 @@ class MockSnapshotManager : public ISnapshotManager {
                (const android::fs_mgr::CreateLogicalPartitionParams& params,
                 std::string* snapshot_path),
                (override));
    MOCK_METHOD(std::unique_ptr<ISnapshotWriter>, OpenSnapshotWriter,
    MOCK_METHOD(std::unique_ptr<ICowWriter>, OpenSnapshotWriter,
                (const android::fs_mgr::CreateLogicalPartitionParams& params), (override));
    MOCK_METHOD(std::unique_ptr<FileDescriptor>, OpenSnapshotReader,
                (const android::fs_mgr::CreateLogicalPartitionParams& params), (override));
    MOCK_METHOD(bool, UnmapUpdateSnapshot, (const std::string& target_partition_name), (override));
    MOCK_METHOD(bool, NeedSnapshotsInFirstStageMount, (), (override));
Loading