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

Commit d03b24d6 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Add additional instance info to log" into main am: da7ca141 am:...

Merge "Add additional instance info to log" into main am: da7ca141 am: 0d28bd51 am: 539f6b01 am: 4b4c3ebb am: 9602328c

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2764465



Change-Id: I613c080f3743b0d5b65c8297d3e0128edb3d1f28
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents e6272a53 9602328c
Loading
Loading
Loading
Loading
+19 −2
Original line number Original line Diff line number Diff line
@@ -18,6 +18,7 @@


#include <android-base/logging.h>
#include <android-base/logging.h>
#include <android-base/properties.h>
#include <android-base/properties.h>
#include <android-base/strings.h>
#include <binder/BpBinder.h>
#include <binder/BpBinder.h>
#include <binder/IPCThreadState.h>
#include <binder/IPCThreadState.h>
#include <binder/ProcessState.h>
#include <binder/ProcessState.h>
@@ -117,10 +118,26 @@ static bool isVintfDeclared(const std::string& name) {
    });
    });


    if (!found) {
    if (!found) {
        std::set<std::string> instances;
        forEachManifest([&](const ManifestWithDescription& mwd) {
            std::set<std::string> res = mwd.manifest->getAidlInstances(aname.package, aname.iface);
            instances.insert(res.begin(), res.end());
            return true;
        });

        std::string available;
        if (instances.empty()) {
            available = "No alternative instances declared in VINTF";
        } else {
            // for logging only. We can't return this information to the client
            // because they may not have permissions to find or list those
            // instances
            available = "VINTF declared instances: " + base::Join(instances, ", ");
        }
        // Although it is tested, explicitly rebuilding qualified name, in case it
        // Although it is tested, explicitly rebuilding qualified name, in case it
        // becomes something unexpected.
        // becomes something unexpected.
        ALOGI("Could not find %s.%s/%s in the VINTF manifest.", aname.package.c_str(),
        ALOGI("Could not find %s.%s/%s in the VINTF manifest. %s.", aname.package.c_str(),
              aname.iface.c_str(), aname.instance.c_str());
              aname.iface.c_str(), aname.instance.c_str(), available.c_str());
    }
    }


    return found;
    return found;