List drm HALs from manifest
To support lazy drm HALs, libmediadrm needs to list all available HALs
that are defined in the manifest. Otherwise, it will only list HALs that
are currently running. This change is necessary because lazy HALs do not
run until they are requested. Without this change, libmediadrm would not
be aware that the lazy HALs are present, and it would not know to call
getService() to start them.
Test: Run gts
Bug: 112386116
Change-Id: I9b41c60d574b9c8c857b8838a5bbdc64388c9ddb
diff --git a/drm/libmediadrm/DrmHal.cpp b/drm/libmediadrm/DrmHal.cpp
index 66c509f..981bd5b 100644
--- a/drm/libmediadrm/DrmHal.cpp
+++ b/drm/libmediadrm/DrmHal.cpp
@@ -24,7 +24,7 @@
#include <binder/IServiceManager.h>
#include <android/hardware/drm/1.2/types.h>
-#include <android/hidl/manager/1.0/IServiceManager.h>
+#include <android/hidl/manager/1.2/IServiceManager.h>
#include <hidl/ServiceManagement.h>
#include <media/EventMetric.h>
@@ -333,10 +333,10 @@
Vector<sp<IDrmFactory>> DrmHal::makeDrmFactories() {
Vector<sp<IDrmFactory>> factories;
- auto manager = hardware::defaultServiceManager();
+ auto manager = hardware::defaultServiceManager1_2();
if (manager != NULL) {
- manager->listByInterface(drm::V1_0::IDrmFactory::descriptor,
+ manager->listManifestByInterface(drm::V1_0::IDrmFactory::descriptor,
[&factories](const hidl_vec<hidl_string> ®istered) {
for (const auto &instance : registered) {
auto factory = drm::V1_0::IDrmFactory::getService(instance);
@@ -346,7 +346,7 @@
}
}
);
- manager->listByInterface(drm::V1_1::IDrmFactory::descriptor,
+ manager->listManifestByInterface(drm::V1_1::IDrmFactory::descriptor,
[&factories](const hidl_vec<hidl_string> ®istered) {
for (const auto &instance : registered) {
auto factory = drm::V1_1::IDrmFactory::getService(instance);