Revert "Revert "Update drm hal to find drm@1.1 factories""
This reverts commit d3eece8aa39560e8458ba8231b8684d99f11ee6b.
Change-Id: I15ca1dba1a384ccc026406f0a9a02c2598873456
diff --git a/drm/libmediadrm/DrmHal.cpp b/drm/libmediadrm/DrmHal.cpp
index 3bbc34b..039e1e9 100644
--- a/drm/libmediadrm/DrmHal.cpp
+++ b/drm/libmediadrm/DrmHal.cpp
@@ -21,8 +21,6 @@
#include <binder/IPCThreadState.h>
#include <binder/IServiceManager.h>
-#include <android/hardware/drm/1.0/IDrmFactory.h>
-#include <android/hardware/drm/1.0/IDrmPlugin.h>
#include <android/hardware/drm/1.0/types.h>
#include <android/hidl/manager/1.0/IServiceManager.h>
#include <hidl/ServiceManagement.h>
@@ -271,15 +269,24 @@
auto manager = hardware::defaultServiceManager();
if (manager != NULL) {
- manager->listByInterface(IDrmFactory::descriptor,
+ manager->listByInterface(drm::V1_0::IDrmFactory::descriptor,
[&factories](const hidl_vec<hidl_string> ®istered) {
for (const auto &instance : registered) {
- auto factory = IDrmFactory::getService(instance);
+ auto factory = drm::V1_0::IDrmFactory::getService(instance);
if (factory != NULL) {
+ ALOGD("found drm@1.0 IDrmFactory %s", instance.c_str());
factories.push_back(factory);
- ALOGI("makeDrmFactories: factory instance %s is %s",
- instance.c_str(),
- factory->isRemote() ? "Remote" : "Not Remote");
+ }
+ }
+ }
+ );
+ manager->listByInterface(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);
+ if (factory != NULL) {
+ ALOGD("found drm@1.1 IDrmFactory %s", instance.c_str());
+ factories.push_back(factory);
}
}
}
@@ -290,7 +297,7 @@
// must be in passthrough mode, load the default passthrough service
auto passthrough = IDrmFactory::getService();
if (passthrough != NULL) {
- ALOGI("makeDrmFactories: using default drm instance");
+ ALOGI("makeDrmFactories: using default passthrough drm instance");
factories.push_back(passthrough);
} else {
ALOGE("Failed to find any drm factories");