Merge "listByInterface -> listManifestByInterface"

This commit is contained in:
Steven Moreland
2019-05-21 16:42:04 +00:00
committed by Gerrit Code Review

View File

@@ -24,7 +24,7 @@
#include <android/hardware/broadcastradio/1.1/IBroadcastRadio.h> #include <android/hardware/broadcastradio/1.1/IBroadcastRadio.h>
#include <android/hardware/broadcastradio/1.1/IBroadcastRadioFactory.h> #include <android/hardware/broadcastradio/1.1/IBroadcastRadioFactory.h>
#include <android/hidl/manager/1.0/IServiceManager.h> #include <android/hidl/manager/1.2/IServiceManager.h>
#include <broadcastradio-utils-1x/Utils.h> #include <broadcastradio-utils-1x/Utils.h>
#include <core_jni_helpers.h> #include <core_jni_helpers.h>
#include <hidl/ServiceManagement.h> #include <hidl/ServiceManagement.h>
@@ -123,13 +123,13 @@ static jobject nativeLoadModules(JNIEnv *env, jobject obj, jlong nativeContext)
auto& ctx = getNativeContext(nativeContext); auto& ctx = getNativeContext(nativeContext);
// Get list of registered HIDL HAL implementations. // Get list of registered HIDL HAL implementations.
auto manager = hardware::defaultServiceManager(); auto manager = hardware::defaultServiceManager1_2();
hidl_vec<hidl_string> services; hidl_vec<hidl_string> services;
if (manager == nullptr) { if (manager == nullptr) {
ALOGE("Can't reach service manager, using default service implementation only"); ALOGE("Can't reach service manager, using default service implementation only");
services = std::vector<hidl_string>({ "default" }); services = std::vector<hidl_string>({ "default" });
} else { } else {
manager->listByInterface(V1_0::IBroadcastRadioFactory::descriptor, manager->listManifestByInterface(V1_0::IBroadcastRadioFactory::descriptor,
[&services](const hidl_vec<hidl_string> &registered) { [&services](const hidl_vec<hidl_string> &registered) {
services = registered; services = registered;
}); });