Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 07770c78 authored by Jiyong Park's avatar Jiyong Park
Browse files

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
parent b0f192f6
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -89,3 +89,5 @@ cc_library_shared {
        "libutils",
    ],
}

subdirs = ["default"]
+23 −0
Original line number Diff line number Diff line
cc_library_static {
    name: "android.hardware.drm@1.0-helper",
    vendor: true,
    defaults: ["hidl_defaults"],
    srcs: [
        "SharedLibrary.cpp",
    ],
    cflags: [
        "-Werror",
        "-Wextra",
        "-Wall",
    ],
    shared_libs: [
        "liblog",
    ],
    header_libs: [
        "libutils_headers",
    ],
    export_header_lib_headers: [
        "libutils_headers",
    ],
    export_include_dirs : ["include"]
}
+6 −1
Original line number Diff line number Diff line
@@ -36,6 +36,9 @@ LOCAL_SHARED_LIBRARIES := \
  libutils \
  libbinder \

LOCAL_STATIC_LIBRARIES := \
  android.hardware.drm@1.0-helper \

LOCAL_C_INCLUDES := \
  hardware/interfaces/drm

@@ -71,10 +74,12 @@ LOCAL_SHARED_LIBRARIES := \
    libhidlmemory \
    libhidltransport \
    liblog \
    libmediadrm \
    libstagefright_foundation_vendor \
    libutils \

LOCAL_STATIC_LIBRARIES := \
    android.hardware.drm@1.0-helper \

LOCAL_C_INCLUDES := \
    frameworks/native/include \
    frameworks/av/include
+3 −2
Original line number Diff line number Diff line
@@ -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 drm {
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 @@ struct CryptoFactory : public ICryptoFactory {
            override;

private:
    android::PluginLoader<android::CryptoFactory> loader;
    PluginLoader<android::CryptoFactory> loader;

    CryptoFactory(const CryptoFactory &) = delete;
    void operator=(const CryptoFactory &) = delete;
+3 −2
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@
#include <android/hardware/drm/1.0/IDrmFactory.h>
#include <hidl/Status.h>
#include <media/drm/DrmAPI.h>
#include <media/PluginLoader.h>
#include <PluginLoader.h>
#include <media/SharedLibrary.h>

namespace android {
@@ -28,6 +28,7 @@ namespace drm {
namespace V1_0 {
namespace implementation {

using ::android::hardware::drm::V1_0::helper::PluginLoader;
using ::android::hardware::drm::V1_0::IDrmFactory;
using ::android::hardware::drm::V1_0::IDrmPlugin;
using ::android::hardware::hidl_array;
@@ -53,7 +54,7 @@ struct DrmFactory : public IDrmFactory {
            const hidl_string& appPackageName, createPlugin_cb _hidl_cb) override;

private:
    android::PluginLoader<android::DrmFactory> loader;
    PluginLoader<android::DrmFactory> loader;

    DrmFactory(const DrmFactory &) = delete;
    void operator=(const DrmFactory &) = delete;
Loading