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

Commit 6fff543a authored by Steven Moreland's avatar Steven Moreland Committed by Automerger Merge Worker
Browse files

Merge changes from topic "vintf-manifest-error-logs-part-ii" into rvc-dev am: 5a1f5498

Change-Id: I7abb62b7972a22ab1c26f256dd8105f5448ff654
parents 5eb786d1 5a1f5498
Loading
Loading
Loading
Loading
+18 −4
Original line number Diff line number Diff line
@@ -49,14 +49,28 @@ static bool isVintfDeclared(const std::string& name) {
    const std::string iface = name.substr(lastDot+1, firstSlash-lastDot-1);
    const std::string instance = name.substr(firstSlash+1);

    for (const auto& manifest : {
            vintf::VintfObject::GetDeviceHalManifest(),
            vintf::VintfObject::GetFrameworkHalManifest()
    struct ManifestWithDescription {
        std::shared_ptr<const vintf::HalManifest> manifest;
        const char* description;
    };
    for (const ManifestWithDescription& mwd : {
            ManifestWithDescription{ vintf::VintfObject::GetDeviceHalManifest(), "device" },
            ManifestWithDescription{ vintf::VintfObject::GetFrameworkHalManifest(), "framework" },
        }) {
        if (manifest != nullptr && manifest->hasAidlInstance(package, iface, instance)) {
        if (mwd.manifest == nullptr) {
          LOG(ERROR) << "NULL VINTF MANIFEST!: " << mwd.description;
          // note, we explicitly do not retry here, so that we can detect VINTF
          // or other bugs (b/151696835)
          continue;
        }
        if (mwd.manifest->hasAidlInstance(package, iface, instance)) {
            LOG(INFO) << "Found " << name << " in " << mwd.description << " VINTF manifest.";
            return true;
        }
    }

    // Although it is tested, explicitly rebuilding qualified name, in case it
    // becomes something unexpected.
    LOG(ERROR) << "Could not find " << package << "." << iface << "/" << instance
               << " in the VINTF manifest.";
    return false;