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

Commit d3eece8a authored by Tobias Thierer's avatar Tobias Thierer
Browse files

Revert "Update drm hal to find drm@1.1 factories"

This reverts commit a3c77911.

Reason for revert: build cop here. The original CL broke build git_master / walleye_asan, hence I'm reverting.

https://android-build.googleplex.com/builds/submitted/4597721/walleye_asan-userdebug/latest/view/logs/build_error.log

In file included from vendor/google/tools/security/fuzzers/libFuzzer/ICrypto_fuzzer/ICrypto_fuzzer.cpp:24:
frameworks/av/include/media/CryptoHal.h:23:10: fatal error: 'android/hardware/drm/1.1/ICryptoFactory.h' file not found

Change-Id: I185d5310cadb9990b864d71e42bba94f4740160c
parent a3c77911
Loading
Loading
Loading
Loading
+6 −15
Original line number Diff line number Diff line
@@ -118,24 +118,15 @@ Vector<sp<ICryptoFactory>> CryptoHal::makeCryptoFactories() {

    auto manager = ::IServiceManager::getService();
    if (manager != NULL) {
        manager->listByInterface(drm::V1_0::ICryptoFactory::descriptor,
        manager->listByInterface(ICryptoFactory::descriptor,
                [&factories](const hidl_vec<hidl_string> &registered) {
                    for (const auto &instance : registered) {
                        auto factory = drm::V1_0::ICryptoFactory::getService(instance);
                        auto factory = ICryptoFactory::getService(instance);
                        if (factory != NULL) {
                            ALOGD("found drm@1.0 ICryptoFactory %s", instance.c_str());
                            factories.push_back(factory);
                        }
                    }
                }
            );
        manager->listByInterface(drm::V1_1::ICryptoFactory::descriptor,
                [&factories](const hidl_vec<hidl_string> &registered) {
                    for (const auto &instance : registered) {
                        auto factory = drm::V1_1::ICryptoFactory::getService(instance);
                        if (factory != NULL) {
                            ALOGD("found drm@1.1 ICryptoFactory %s", instance.c_str());
                            factories.push_back(factory);
                            ALOGI("makeCryptoFactories: factory instance %s is %s",
                                    instance.c_str(),
                                    factory->isRemote() ? "Remote" : "Not Remote");
                        }
                    }
                }
@@ -146,7 +137,7 @@ Vector<sp<ICryptoFactory>> CryptoHal::makeCryptoFactories() {
        // must be in passthrough mode, load the default passthrough service
        auto passthrough = ICryptoFactory::getService();
        if (passthrough != NULL) {
            ALOGI("makeCryptoFactories: using default passthrough crypto instance");
            ALOGI("makeCryptoFactories: using default crypto instance");
            factories.push_back(passthrough);
        } else {
            ALOGE("Failed to find any crypto factories");
+8 −15
Original line number Diff line number Diff line
@@ -21,6 +21,8 @@
#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>
@@ -269,24 +271,15 @@ Vector<sp<IDrmFactory>> DrmHal::makeDrmFactories() {
    auto manager = hardware::defaultServiceManager();

    if (manager != NULL) {
        manager->listByInterface(drm::V1_0::IDrmFactory::descriptor,
        manager->listByInterface(IDrmFactory::descriptor,
                [&factories](const hidl_vec<hidl_string> &registered) {
                    for (const auto &instance : registered) {
                        auto factory = drm::V1_0::IDrmFactory::getService(instance);
                        auto factory = IDrmFactory::getService(instance);
                        if (factory != NULL) {
                            ALOGD("found drm@1.0 IDrmFactory %s", instance.c_str());
                            factories.push_back(factory);
                        }
                    }
                }
            );
        manager->listByInterface(drm::V1_1::IDrmFactory::descriptor,
                [&factories](const hidl_vec<hidl_string> &registered) {
                    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);
                            ALOGI("makeDrmFactories: factory instance %s is %s",
                                    instance.c_str(),
                                    factory->isRemote() ? "Remote" : "Not Remote");
                        }
                    }
                }
@@ -297,7 +290,7 @@ Vector<sp<IDrmFactory>> DrmHal::makeDrmFactories() {
        // must be in passthrough mode, load the default passthrough service
        auto passthrough = IDrmFactory::getService();
        if (passthrough != NULL) {
            ALOGI("makeDrmFactories: using default passthrough drm instance");
            ALOGI("makeDrmFactories: using default drm instance");
            factories.push_back(passthrough);
        } else {
            ALOGE("Failed to find any drm factories");
+3 −5
Original line number Diff line number Diff line
@@ -20,16 +20,14 @@

#include <android/hardware/drm/1.0/ICryptoFactory.h>
#include <android/hardware/drm/1.0/ICryptoPlugin.h>
#include <android/hardware/drm/1.1/ICryptoFactory.h>

#include <media/ICrypto.h>
#include <utils/KeyedVector.h>
#include <utils/threads.h>

namespace drm = ::android::hardware::drm;
using drm::V1_0::ICryptoFactory;
using drm::V1_0::ICryptoPlugin;
using drm::V1_0::SharedBuffer;
using ::android::hardware::drm::V1_0::ICryptoFactory;
using ::android::hardware::drm::V1_0::ICryptoPlugin;
using ::android::hardware::drm::V1_0::SharedBuffer;

class IMemoryHeap;

+2 −3
Original line number Diff line number Diff line
@@ -18,11 +18,10 @@

#define DRM_HAL_H_

#include <android/hardware/drm/1.0/IDrmFactory.h>
#include <android/hardware/drm/1.0/IDrmPlugin.h>
#include <android/hardware/drm/1.0/IDrmPluginListener.h>
#include <android/hardware/drm/1.1/IDrmFactory.h>
#include <android/hardware/drm/1.1/IDrmPlugin.h>
#include <android/hardware/drm/1.0/IDrmPluginListener.h>
#include <android/hardware/drm/1.0/IDrmFactory.h>

#include <media/DrmMetrics.h>
#include <media/IDrm.h>