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

Commit 382c50ea authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8340624 from a3b73891 to tm-release

Change-Id: Iedc657fcb96b38cf33d2294206703ebebe89501a
parents dfb70f94 a3b73891
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -124,6 +124,26 @@ bootclasspath_fragment {
    // modified by the Soong or platform compat team.
    hidden_api: {
        max_target_o_low_priority: ["hiddenapi/hiddenapi-max-target-o-low-priority.txt"],

        // The following packages contain classes from other modules on the
        // bootclasspath. That means that the hidden API flags for this module
        // has to explicitly list every single class this module provides in
        // that package to differentiate them from the classes provided by other
        // modules. That can include private classes that are not part of the
        // API.
        split_packages: [
            "android.media",
        ],

        // The following packages and all their subpackages currently only
        // contain classes from this bootclasspath_fragment. Listing a package
        // here won't prevent other bootclasspath modules from adding classes in
        // any of those packages but it will prevent them from adding those
        // classes into an API surface, e.g. public, system, etc.. Doing so will
        // result in a build failure due to inconsistent flags.
        package_prefixes: [
            "android.media.internal",
        ],
    },
}

+7 −0
Original line number Diff line number Diff line
@@ -286,4 +286,11 @@ status_t DrmHal::getLogMessages(Vector<drm::V1_4::LogMessage>& logs) const {
    return mDrmHalHidl->getLogMessages(logs);
}

status_t DrmHal::getSupportedSchemes(std::vector<uint8_t> &schemes) const {
    status_t statusResult;
    statusResult = mDrmHalAidl->getSupportedSchemes(schemes);
    if (statusResult == OK) return statusResult;
    return mDrmHalHidl->getSupportedSchemes(schemes);
}

}  // namespace android
+19 −0
Original line number Diff line number Diff line
@@ -1189,6 +1189,25 @@ std::string DrmHalAidl::reportFrameworkMetrics(const std::string& pluginMetrics)
    return serializedMetrics;
}

status_t DrmHalAidl::getSupportedSchemes(std::vector<uint8_t> &schemes) const {
    Mutex::Autolock autoLock(mLock);

    if (mFactories.empty()) return UNKNOWN_ERROR;
    for (ssize_t i = mFactories.size() - 1; i >= 0; i--) {
        CryptoSchemes curSchemes{};
        auto err = mFactories[i]->getSupportedCryptoSchemes(&curSchemes);
        if (!err.isOk()) {
            continue;
        }

        for (auto uuidObj : curSchemes.uuids) {
            schemes.insert(schemes.end(), uuidObj.uuid.begin(), uuidObj.uuid.end());
        }
    }

    return OK;
}

void DrmHalAidl::cleanup() {
    closeOpenSessions();

+20 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include <aidl/android/media/BnResourceManagerClient.h>
#include <android/binder_manager.h>
#include <android/hardware/drm/1.2/types.h>
#include <android/hardware/drm/1.3/IDrmFactory.h>
#include <android/hidl/manager/1.2/IServiceManager.h>
#include <hidl/ServiceManagement.h>
#include <media/EventMetric.h>
@@ -1514,4 +1515,23 @@ status_t DrmHalHidl::getLogMessages(Vector<drm::V1_4::LogMessage>& logs) const {
    return DrmUtils::GetLogMessages<drm::V1_4::IDrmPlugin>(mPlugin, logs);
}

status_t DrmHalHidl::getSupportedSchemes(std::vector<uint8_t> &schemes) const {
    Mutex::Autolock autoLock(mLock);
    for (auto &factory : mFactories) {
        sp<drm::V1_3::IDrmFactory> factoryV1_3 = drm::V1_3::IDrmFactory::castFrom(factory);
        if (factoryV1_3 == nullptr) {
            continue;
        }

        factoryV1_3->getSupportedCryptoSchemes(
            [&](const hardware::hidl_vec<hardware::hidl_array<uint8_t, 16>>& schemes_hidl) {
                for (const auto &scheme : schemes_hidl) {
                    schemes.insert(schemes.end(), scheme.data(), scheme.data() + scheme.size());
                }
            });
    }

    return OK;
}

}  // namespace android
+1 −0
Original line number Diff line number Diff line
@@ -117,6 +117,7 @@ struct DrmHal : public IDrm {
            Vector<uint8_t> const &sessionId,
            const char *playbackId);
    virtual status_t getLogMessages(Vector<drm::V1_4::LogMessage> &logs) const;
    virtual status_t getSupportedSchemes(std::vector<uint8_t> &schemes) const;

private:
    sp<IDrm> mDrmHalHidl;
Loading