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

Commit d7eeb79f authored by Mitchell Wills's avatar Mitchell Wills Committed by Automerger Merge Worker
Browse files

Merge "Add logs in SuperLayoutBuilder::Open when the metadata isn't supported"...

Merge "Add logs in SuperLayoutBuilder::Open when the metadata isn't supported" into main am: b7cfba1c am: cf244ae1 am: 9c1acfcc am: a4a9e922

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2665257



Change-Id: I164d1f2ac788b1a72233b7945255674494d69264
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents bbd3f5c3 a4a9e922
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -46,21 +46,21 @@ bool SuperLayoutBuilder::Open(const void* data, size_t size) {
bool SuperLayoutBuilder::Open(const LpMetadata& metadata) {
bool SuperLayoutBuilder::Open(const LpMetadata& metadata) {
    for (const auto& partition : metadata.partitions) {
    for (const auto& partition : metadata.partitions) {
        if (partition.attributes & LP_PARTITION_ATTR_SLOT_SUFFIXED) {
        if (partition.attributes & LP_PARTITION_ATTR_SLOT_SUFFIXED) {
            // Retrofit devices are not supported.
            LOG(ERROR) << "Retrofit devices are not supported";
            return false;
            return false;
        }
        }
        if (!(partition.attributes & LP_PARTITION_ATTR_READONLY)) {
        if (!(partition.attributes & LP_PARTITION_ATTR_READONLY)) {
            // Writable partitions are not supported.
            LOG(ERROR) << "Writable partitions are not supported";
            return false;
            return false;
        }
        }
    }
    }
    if (!metadata.extents.empty()) {
    if (!metadata.extents.empty()) {
        // Partitions that already have extents are not supported (should
        LOG(ERROR) << "Partitions that already have extents are not supported";
        // never be true of super_empty.img).
        // should never be true of super_empty.img.
        return false;
        return false;
    }
    }
    if (metadata.block_devices.size() != 1) {
    if (metadata.block_devices.size() != 1) {
        // Only one "super" is supported.
        LOG(ERROR) << "Only one 'super' is supported";
        return false;
        return false;
    }
    }