diff options
| author | 2023-09-27 20:51:13 +0000 | |
|---|---|---|
| committer | 2023-09-27 20:51:13 +0000 | |
| commit | 4b4c3ebbc849ccba7777a2a34be5aa00d53a203b (patch) | |
| tree | e21991365e0529e0d4f858c603e507feb285ae4e /cmds/servicemanager/ServiceManager.cpp | |
| parent | 54b2ad4c79a46f7ac7a4c70f0c1c98267aedd2ed (diff) | |
| parent | 539f6b010eb55de2bfadd4c633de73704321503f (diff) | |
Merge "Add additional instance info to log" into main am: da7ca1417c am: 0d28bd5122 am: 539f6b010e
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2764465
Change-Id: If5fe2c67eaf5d81f6c0e0304fc870c80bf4194cc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'cmds/servicemanager/ServiceManager.cpp')
| -rw-r--r-- | cmds/servicemanager/ServiceManager.cpp | 21 | 
1 files changed, 19 insertions, 2 deletions
diff --git a/cmds/servicemanager/ServiceManager.cpp b/cmds/servicemanager/ServiceManager.cpp index f6e4ec3c0d..77989d148b 100644 --- a/cmds/servicemanager/ServiceManager.cpp +++ b/cmds/servicemanager/ServiceManager.cpp @@ -18,6 +18,7 @@  #include <android-base/logging.h>  #include <android-base/properties.h> +#include <android-base/strings.h>  #include <binder/BpBinder.h>  #include <binder/IPCThreadState.h>  #include <binder/ProcessState.h> @@ -117,10 +118,26 @@ static bool isVintfDeclared(const std::string& name) {      });      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          // becomes something unexpected. -        ALOGI("Could not find %s.%s/%s in the VINTF manifest.", aname.package.c_str(), -              aname.iface.c_str(), aname.instance.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(), available.c_str());      }      return found;  |