summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com>2023-09-27 16:12:48 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2023-09-27 16:12:48 +0000
commitda7ca1417c58c4a92a4b3c6597c9a144006a2acb (patch)
tree6e2ff8596d2ddbd4525a576a7b158eddeb8e81d0
parent553da45cd7f4704f4466bbc113c5ef58a04cbc2c (diff)
parent42407bc5607b1169accb306d301e3899f6925863 (diff)
downloadnative-da7ca1417c58c4a92a4b3c6597c9a144006a2acb.tar.gz
Merge "Add additional instance info to log" into main
-rw-r--r--cmds/servicemanager/ServiceManager.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/cmds/servicemanager/ServiceManager.cpp b/cmds/servicemanager/ServiceManager.cpp
index cae9684cc4..facb8b133b 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>
@@ -112,10 +113,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;