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

Commit 295dcb97 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" am: 4c51ebbb...

Merge changes from topic "vintf-manifest-error-logs-part-ii" am: 4c51ebbb am: 6dd0cae0 am: 844f21a6 am: bcaafd91

Change-Id: If42311c1ffab782a0838661b3f823a521ed45073
parents c9500a09 bcaafd91
Loading
Loading
Loading
Loading
+33 −12
Original line number Original line 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 iface = name.substr(lastDot+1, firstSlash-lastDot-1);
    const std::string instance = name.substr(firstSlash+1);
    const std::string instance = name.substr(firstSlash+1);


    for (const auto& manifest : {
    struct ManifestWithDescription {
            vintf::VintfObject::GetDeviceHalManifest(),
        std::shared_ptr<const vintf::HalManifest> manifest;
            vintf::VintfObject::GetFrameworkHalManifest()
        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;
            return true;
        }
        }
    }
    }

    // Although it is tested, explicitly rebuilding qualified name, in case it
    // becomes something unexpected.
    LOG(ERROR) << "Could not find " << package << "." << iface << "/" << instance
    LOG(ERROR) << "Could not find " << package << "." << iface << "/" << instance
               << " in the VINTF manifest.";
               << " in the VINTF manifest.";
    return false;
    return false;
@@ -72,13 +86,20 @@ static bool meetsDeclarationRequirements(const sp<IBinder>& binder, const std::s
#endif  // !VENDORSERVICEMANAGER
#endif  // !VENDORSERVICEMANAGER


ServiceManager::ServiceManager(std::unique_ptr<Access>&& access) : mAccess(std::move(access)) {
ServiceManager::ServiceManager(std::unique_ptr<Access>&& access) : mAccess(std::move(access)) {
#ifndef VENDORSERVICEMANAGER
// TODO(b/151696835): reenable performance hack when we solve bug, since with
    // can process these at any times, don't want to delay first VINTF client
//     this hack and other fixes, it is unlikely we will see even an ephemeral
    std::thread([] {
//     failure when the manifest parse fails. The goal is that the manifest will
        vintf::VintfObject::GetDeviceHalManifest();
//     be read incorrectly and cause the process trying to register a HAL to
        vintf::VintfObject::GetFrameworkHalManifest();
//     fail. If this is in fact an early boot kernel contention issue, then we
    }).detach();
//     will get no failure, and by its absence, be signalled to invest more
#endif  // !VENDORSERVICEMANAGER
//     effort in re-adding this performance hack.
// #ifndef VENDORSERVICEMANAGER
//     // can process these at any times, don't want to delay first VINTF client
//     std::thread([] {
//         vintf::VintfObject::GetDeviceHalManifest();
//         vintf::VintfObject::GetFrameworkHalManifest();
//     }).detach();
// #endif  // !VENDORSERVICEMANAGER
}
}
ServiceManager::~ServiceManager() {
ServiceManager::~ServiceManager() {
    // this should only happen in tests
    // this should only happen in tests