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

Commit 6b1a164e authored by Yo Chiang's avatar Yo Chiang Committed by Automerger Merge Worker
Browse files

Merge "Improve ImageManager error message" am: 5ca85a05

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

Change-Id: I5ea2586e32af118978446a42a5d801ca763a419a
parents 792650d4 5ca85a05
Loading
Loading
Loading
Loading
+10 −4
Original line number Original line Diff line number Diff line
@@ -640,16 +640,22 @@ bool ImageManager::Validate() {
        return false;
        return false;
    }
    }


    bool ok = true;
    for (const auto& partition : metadata->partitions) {
    for (const auto& partition : metadata->partitions) {
        auto name = GetPartitionName(partition);
        auto name = GetPartitionName(partition);
        auto image_path = GetImageHeaderPath(name);
        auto image_path = GetImageHeaderPath(name);
        auto fiemap = SplitFiemap::Open(image_path);
        auto fiemap = SplitFiemap::Open(image_path);
        if (!fiemap || !fiemap->HasPinnedExtents()) {
        if (fiemap == nullptr) {
            LOG(ERROR) << "Image is missing or was moved: " << image_path;
            LOG(ERROR) << "SplitFiemap::Open(\"" << image_path << "\") failed";
            return false;
            ok = false;
            continue;
        }
        }
        if (!fiemap->HasPinnedExtents()) {
            LOG(ERROR) << "Image doesn't have pinned extents: " << image_path;
            ok = false;
        }
        }
    return true;
    }
    return ok;
}
}


bool ImageManager::DisableImage(const std::string& name) {
bool ImageManager::DisableImage(const std::string& name) {