Remove dependency to libmediadrm from drm HAL
drm HAL has been using libmediadrm for android::SharedLibrary class and
android::PluginLoader class. This is a Treble violation since
libmediadrm is a framework-only library that is not available to
vendors.
To solve the problem, the two classes are copied into this directory
to form a small static library android.hardware.drm@1.0-helper.a.
Bug: 38302533
Test: mm under /hardware/interfaces/drm/1.0/default and
/hardware/interfaces/drm/1.0/vts/functional
Change-Id: I7b4e5cdb3bc815e971e0c3b7ec99ea86042e13eb
diff --git a/drm/1.0/default/CryptoFactory.h b/drm/1.0/default/CryptoFactory.h
index 412b557..6b1d1ff 100644
--- a/drm/1.0/default/CryptoFactory.h
+++ b/drm/1.0/default/CryptoFactory.h
@@ -19,7 +19,7 @@
#include <android/hardware/drm/1.0/ICryptoFactory.h>
#include <hidl/Status.h>
#include <media/hardware/CryptoAPI.h>
-#include <media/PluginLoader.h>
+#include <PluginLoader.h>
#include <media/SharedLibrary.h>
namespace android {
@@ -28,6 +28,7 @@
namespace V1_0 {
namespace implementation {
+using ::android::hardware::drm::V1_0::helper::PluginLoader;
using ::android::hardware::drm::V1_0::ICryptoFactory;
using ::android::hardware::drm::V1_0::ICryptoPlugin;
using ::android::hardware::hidl_array;
@@ -51,7 +52,7 @@
override;
private:
- android::PluginLoader<android::CryptoFactory> loader;
+ PluginLoader<android::CryptoFactory> loader;
CryptoFactory(const CryptoFactory &) = delete;
void operator=(const CryptoFactory &) = delete;