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

Commit 946829e3 authored by David Anderson's avatar David Anderson Committed by android-build-merger
Browse files

Merge "liblp: Add partitions to the correct group when writing LpMetadata."...

Merge "liblp: Add partitions to the correct group when writing LpMetadata." am: 4bc53d20 am: e6d28b43
am: 302be2bf

Change-Id: I9c8cc6823a8d12baef74d467e23c95912425849d
parents dcaf866f 302be2bf
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -505,6 +505,7 @@ std::unique_ptr<LpMetadata> MetadataBuilder::Export() {
        strncpy(out.name, group->name().c_str(), sizeof(out.name));
        out.maximum_size = group->maximum_size();

        group_indices[group->name()] = metadata->groups.size();
        metadata->groups.push_back(out);
    }

@@ -528,6 +529,14 @@ std::unique_ptr<LpMetadata> MetadataBuilder::Export() {
        part.num_extents = static_cast<uint32_t>(partition->extents().size());
        part.attributes = partition->attributes();

        auto iter = group_indices.find(partition->group_name());
        if (iter == group_indices.end()) {
            LERROR << "Partition " << partition->name() << " is a member of unknown group "
                   << partition->group_name();
            return nullptr;
        }
        part.group_index = iter->second;

        for (const auto& extent : partition->extents()) {
            extent->AddTo(metadata.get());
        }