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

Commit e192a672 authored by Steven Moreland's avatar Steven Moreland
Browse files

Log VINTF manifest success/failure cases.

These logs are critical to understand the operation of the system, and
do not spam (1/hal start or 1/hal request). Most importantly, if a
manifest fails to be read for whatever reason, this is logged (null
manifest case).

Bug: 151696835
Test: boot, and verify logs of successful hal retrivals
Test: boot, and verify logs w/ patch which causes VINTF to fail the
  first time, and verify that this causes a single crash which gives us
  the ability to still find and detect a critical error, but allows the
  system functionality to continue to work.
Change-Id: I0a26b875947878656d6eda03ffebce97ebb6139e
Merged-In: I0a26b875947878656d6eda03ffebce97ebb6139e
parent d221c251
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;