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

Commit 90383f07 authored by Jeff Tinker's avatar Jeff Tinker Committed by android-build-merger
Browse files

Merge "DrmHal: add key status usable_in_future" into qt-dev

am: 2f81c334

Change-Id: I4e5f69af9fda4dbf01f217a17cfd02dcbea1cd91
parents f10f2804 2f81c334
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@ cc_library_shared {
    shared_libs: [
        "android.hardware.drm@1.0",
        "android.hardware.drm@1.1",
        "android.hardware.drm@1.2",
        "libbinder",
        "libhidlbase",
        "liblog",
@@ -89,6 +90,7 @@ cc_library_shared {
    shared_libs: [
        "android.hardware.drm@1.0",
        "android.hardware.drm@1.1",
        "android.hardware.drm@1.2",
        "libbase",
        "libbinder",
        "libhidlbase",
+15 −1
Original line number Diff line number Diff line
@@ -40,7 +40,6 @@
#include <mediadrm/DrmSessionManager.h>

using drm::V1_0::KeyedVector;
using drm::V1_0::KeyStatusType;
using drm::V1_0::KeyRequestType;
using drm::V1_0::KeyType;
using drm::V1_0::KeyValue;
@@ -51,6 +50,7 @@ using drm::V1_1::HdcpLevel;
using drm::V1_1::SecureStopRelease;
using drm::V1_1::SecurityLevel;
using drm::V1_2::KeySetId;
using drm::V1_2::KeyStatusType;
using ::android::hardware::drm::V1_1::DrmMetricGroup;
using ::android::hardware::hidl_array;
using ::android::hardware::hidl_string;
@@ -517,6 +517,17 @@ Return<void> DrmHal::sendExpirationUpdate(const hidl_vec<uint8_t>& sessionId,
}

Return<void> DrmHal::sendKeysChange(const hidl_vec<uint8_t>& sessionId,
        const hidl_vec<KeyStatus_V1_0>& keyStatusList_V1_0, bool hasNewUsableKey) {
    std::vector<KeyStatus> keyStatusVec;
    for (const auto &keyStatus_V1_0 : keyStatusList_V1_0) {
        keyStatusVec.push_back({keyStatus_V1_0.keyId,
                static_cast<KeyStatusType>(keyStatus_V1_0.type)});
    }
    hidl_vec<KeyStatus> keyStatusList_V1_2(keyStatusVec);
    return sendKeysChange_1_2(sessionId, keyStatusList_V1_2, hasNewUsableKey);
}

Return<void> DrmHal::sendKeysChange_1_2(const hidl_vec<uint8_t>& sessionId,
        const hidl_vec<KeyStatus>& keyStatusList, bool hasNewUsableKey) {

    mEventLock.lock();
@@ -546,6 +557,9 @@ Return<void> DrmHal::sendKeysChange(const hidl_vec<uint8_t>& sessionId,
            case KeyStatusType::STATUSPENDING:
                type = DrmPlugin::kKeyStatusType_StatusPending;
                break;
            case KeyStatusType::USABLEINFUTURE:
                type = DrmPlugin::kKeyStatusType_UsableInFuture;
                break;
            case KeyStatusType::INTERNALERROR:
            default:
                type = DrmPlugin::kKeyStatusType_InternalError;
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ using ::android::drm_metrics::DrmFrameworkMetrics;
using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec;
using ::android::hardware::drm::V1_0::EventType;
using ::android::hardware::drm::V1_0::KeyStatusType;
using ::android::hardware::drm::V1_2::KeyStatusType;
using ::android::hardware::drm::V1_1::DrmMetricGroup;
using ::android::os::PersistableBundle;

+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@
using ::android::drm_metrics::DrmFrameworkMetrics;
using ::android::hardware::hidl_vec;
using ::android::hardware::drm::V1_0::EventType;
using ::android::hardware::drm::V1_0::KeyStatusType;
using ::android::hardware::drm::V1_2::KeyStatusType;
using ::android::hardware::drm::V1_0::Status;
using ::android::hardware::drm::V1_1::DrmMetricGroup;
using ::android::os::PersistableBundle;
+6 −6
Original line number Diff line number Diff line
@@ -51,16 +51,16 @@ Status InitDataParser::parse(const std::vector<uint8_t>& initData,
    // Build a list of the key IDs
    std::vector<const uint8_t*> keyIds;

    if (mimeType == kIsoBmffVideoMimeType ||
        mimeType == kIsoBmffAudioMimeType ||
        mimeType == kCencInitDataFormat) {
    if (mimeType == kIsoBmffVideoMimeType.c_str() ||
        mimeType == kIsoBmffAudioMimeType.c_str() ||
        mimeType == kCencInitDataFormat.c_str()) {
        Status res = parsePssh(initData, &keyIds);
        if (res != Status::OK) {
            return res;
        }
    } else if (mimeType == kWebmVideoMimeType ||
        mimeType == kWebmAudioMimeType ||
        mimeType == kWebmInitDataFormat) {
    } else if (mimeType == kWebmVideoMimeType.c_str() ||
        mimeType == kWebmAudioMimeType.c_str() ||
        mimeType == kWebmInitDataFormat.c_str()) {
        // WebM "init data" is just a single key ID
        if (initData.size() != kKeyIdSize) {
            return Status::ERROR_DRM_CANNOT_HANDLE;
Loading