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

Commit 99e482eb authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "clearkey aidl: misc fixes"

parents b1dc2c95 3b6149c6
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -72,7 +72,8 @@ using ::aidl::android::hardware::drm::Uuid;
    // This should match the in_mimeTypes handed by InitDataParser.
    // This should match the in_mimeTypes handed by InitDataParser.
    *_aidl_return = in_mimeType == kIsoBmffVideoMimeType || in_mimeType == kIsoBmffAudioMimeType ||
    *_aidl_return = in_mimeType == kIsoBmffVideoMimeType || in_mimeType == kIsoBmffAudioMimeType ||
                    in_mimeType == kCencInitDataFormat || in_mimeType == kWebmVideoMimeType ||
                    in_mimeType == kCencInitDataFormat || in_mimeType == kWebmVideoMimeType ||
                    in_mimeType == kWebmAudioMimeType || in_mimeType == kWebmInitDataFormat;
                    in_mimeType == kWebmAudioMimeType || in_mimeType == kWebmInitDataFormat ||
                    in_mimeType.empty();
    return ::ndk::ScopedAStatus::ok();
    return ::ndk::ScopedAStatus::ok();
}
}


@@ -85,7 +86,9 @@ using ::aidl::android::hardware::drm::Uuid;
        ALOGD("%s mime type is not supported by crypto scheme", in_mimeType.c_str());
        ALOGD("%s mime type is not supported by crypto scheme", in_mimeType.c_str());
    }
    }
    *_aidl_return = isClearKeyUUID(in_uuid.uuid.data()) && isSupportedMimeType &&
    *_aidl_return = isClearKeyUUID(in_uuid.uuid.data()) && isSupportedMimeType &&
                    in_securityLevel == SecurityLevel::SW_SECURE_CRYPTO;
                    (in_securityLevel == SecurityLevel::SW_SECURE_CRYPTO ||
                     in_securityLevel == SecurityLevel::DEFAULT ||
                     in_securityLevel == SecurityLevel::UNKNOWN);
    return ::ndk::ScopedAStatus::ok();
    return ::ndk::ScopedAStatus::ok();
}
}


+9 −7
Original line number Original line Diff line number Diff line
@@ -21,6 +21,7 @@
#include <inttypes.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdio.h>
#include <chrono>
#include <chrono>
#include <set>


#include "AidlUtils.h"
#include "AidlUtils.h"
#include "ClearKeyDrmProperties.h"
#include "ClearKeyDrmProperties.h"
@@ -188,7 +189,8 @@ void DrmPlugin::installSecureStop(const std::vector<uint8_t>& sessionId) {


    const std::vector<uint8_t> scopeId = in_scope;
    const std::vector<uint8_t> scopeId = in_scope;
    ::android::sp<Session> session;
    ::android::sp<Session> session;
    if (in_keyType == KeyType::STREAMING || in_keyType == KeyType::OFFLINE) {
    std::set<KeyType> init_types{KeyType::STREAMING, KeyType::OFFLINE};
    if (init_types.count(in_keyType)) {
        std::vector<uint8_t> sessionId(scopeId.begin(), scopeId.end());
        std::vector<uint8_t> sessionId(scopeId.begin(), scopeId.end());
        session = mSessionLibrary->findSession(sessionId);
        session = mSessionLibrary->findSession(sessionId);
        if (!session.get()) {
        if (!session.get()) {
@@ -402,8 +404,8 @@ void DrmPlugin::installSecureStop(const std::vector<uint8_t>& sessionId) {
    auto itr = mSecureStops.find(in_secureStopId.secureStopId);
    auto itr = mSecureStops.find(in_secureStopId.secureStopId);
    if (itr != mSecureStops.end()) {
    if (itr != mSecureStops.end()) {
        ClearkeySecureStop clearkeyStop = itr->second;
        ClearkeySecureStop clearkeyStop = itr->second;
        stop.assign(clearkeyStop.id.begin(), clearkeyStop.id.end());
        stop.insert(stop.end(), clearkeyStop.id.begin(), clearkeyStop.id.end());
        stop.assign(clearkeyStop.data.begin(), clearkeyStop.data.end());
        stop.insert(stop.end(), clearkeyStop.data.begin(), clearkeyStop.data.end());
    }
    }
    mSecureStopLock.unlock();
    mSecureStopLock.unlock();


@@ -439,9 +441,9 @@ void DrmPlugin::installSecureStop(const std::vector<uint8_t>& sessionId) {
    std::vector<::aidl::android::hardware::drm::SecureStop> stops;
    std::vector<::aidl::android::hardware::drm::SecureStop> stops;
    for (auto itr = mSecureStops.begin(); itr != mSecureStops.end(); ++itr) {
    for (auto itr = mSecureStops.begin(); itr != mSecureStops.end(); ++itr) {
        ClearkeySecureStop clearkeyStop = itr->second;
        ClearkeySecureStop clearkeyStop = itr->second;
        std::vector<uint8_t> stop = {};
        std::vector<uint8_t> stop{};
        stop.assign(clearkeyStop.id.begin(), clearkeyStop.id.end());
        stop.insert(stop.end(), clearkeyStop.id.begin(), clearkeyStop.id.end());
        stop.assign(clearkeyStop.data.begin(), clearkeyStop.data.end());
        stop.insert(stop.end(), clearkeyStop.data.begin(), clearkeyStop.data.end());


        SecureStop secureStop;
        SecureStop secureStop;
        secureStop.opaqueData = stop;
        secureStop.opaqueData = stop;
@@ -476,7 +478,7 @@ void DrmPlugin::installSecureStop(const std::vector<uint8_t>& sessionId) {
        return toNdkScopedAStatus(Status::ERROR_DRM_INVALID_STATE);
        return toNdkScopedAStatus(Status::ERROR_DRM_INVALID_STATE);
    }
    }


    *_aidl_return = itr->second;
    *_aidl_return = SecurityLevel::SW_SECURE_CRYPTO;
    return toNdkScopedAStatus(Status::OK);
    return toNdkScopedAStatus(Status::OK);
}
}


+1 −1
Original line number Original line Diff line number Diff line
@@ -23,7 +23,7 @@


namespace clearkeydrm {
namespace clearkeydrm {


class SessionLibrary : public ::android::RefBase {
class SessionLibrary {
  public:
  public:
    static SessionLibrary* get();
    static SessionLibrary* get();