summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--transport/ServiceManagement.cpp9
-rw-r--r--transport/manager/1.2/IServiceManager.hal17
2 files changed, 16 insertions, 10 deletions
diff --git a/transport/ServiceManagement.cpp b/transport/ServiceManagement.cpp
index 40a7ff5..e7bec41 100644
--- a/transport/ServiceManagement.cpp
+++ b/transport/ServiceManagement.cpp
@@ -238,9 +238,8 @@ sp<IServiceManager1_2> defaultServiceManager1_2() {
return gDefaultServiceManager;
}
-std::vector<std::string> search(const std::string &path,
- const std::string &prefix,
- const std::string &suffix) {
+static std::vector<std::string> findFiles(const std::string& path, const std::string& prefix,
+ const std::string& suffix) {
std::unique_ptr<DIR, decltype(&closedir)> dir(opendir(path.c_str()), closedir);
if (!dir) return {};
@@ -388,7 +387,7 @@ struct PassthroughServiceManager : IServiceManager1_1 {
#endif
for (const std::string& path : paths) {
- std::vector<std::string> libs = search(path, prefix, ".so");
+ std::vector<std::string> libs = findFiles(path, prefix, ".so");
for (const std::string &lib : libs) {
const std::string fullPath = path + lib;
@@ -509,7 +508,7 @@ struct PassthroughServiceManager : IServiceManager1_1 {
for (const auto &pair : sAllPaths) {
Arch arch = pair.first;
for (const auto &path : pair.second) {
- std::vector<std::string> libs = search(path, "", ".so");
+ std::vector<std::string> libs = findFiles(path, "", ".so");
for (const std::string &lib : libs) {
std::string matchedName;
std::string implName;
diff --git a/transport/manager/1.2/IServiceManager.hal b/transport/manager/1.2/IServiceManager.hal
index ae3fdfd..e1629d6 100644
--- a/transport/manager/1.2/IServiceManager.hal
+++ b/transport/manager/1.2/IServiceManager.hal
@@ -21,11 +21,6 @@ import @1.1::IServiceManager;
import IClientCallback;
interface IServiceManager extends @1.1::IServiceManager {
- // TODO(b/66921961): additional functionality for the next release:
- // - Better notifications (onRegistration will contain the interface)
- // - Method to list interfaces in the manifest (for b/76108617, since if they are
- // lazy, they will no longer show up in listByInterface)
-
/**
* Adds a callback that must be called when the specified server has no clients.
*
@@ -66,4 +61,16 @@ interface IServiceManager extends @1.1::IServiceManager {
* @return success Whether or not the service was registered.
*/
addWithChain(string name, interface service, vec<string> chain) generates (bool success);
+
+ /**
+ * List all instances of a particular service from the manifest. Must be sorted. These HALs
+ * may not be started if they are lazy.
+ *
+ * See also @1.0::IServiceManager's listByInterface function.
+ *
+ * @param fqName Fully-qualified interface name.
+ *
+ * @return instanceNames List of instance names running the particular service.
+ */
+ listManifestByInterface(string fqName) generates (vec<string> instanceNames);
};