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

Commit 6917306f authored by Kyle Zhang's avatar Kyle Zhang Committed by Automerger Merge Worker
Browse files

Merge "Add aidl version property to clearkey plugin" into tm-dev am: 3c56c244

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/av/+/17084276

Change-Id: I55f35363d106e9c770594a380620e2d4ecdf6e49
parents 429efb56 3c56c244
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
#include "DrmPlugin.h"
#include "Session.h"
#include "Utils.h"
#include "AidlClearKeryProperties.h"

namespace {
const std::string kKeySetIdPrefix("ckid");
@@ -81,12 +82,13 @@ DrmPlugin::DrmPlugin(SessionLibrary* sessionLibrary)

void DrmPlugin::initProperties() {
    mStringProperties.clear();
    mStringProperties[kVendorKey] = kVendorValue;
    mStringProperties[kVendorKey] = kAidlVendorValue;
    mStringProperties[kVersionKey] = kVersionValue;
    mStringProperties[kPluginDescriptionKey] = kPluginDescriptionValue;
    mStringProperties[kAlgorithmsKey] = kAlgorithmsValue;
    mStringProperties[kListenerTestSupportKey] = kListenerTestSupportValue;
    mStringProperties[kDrmErrorTestKey] = kDrmErrorTestValue;
    mStringProperties[kPluginDescriptionKey] = kAidlPluginDescriptionValue;
    mStringProperties[kAlgorithmsKey] = kAidlAlgorithmsValue;
    mStringProperties[kListenerTestSupportKey] = kAidlListenerTestSupportValue;
    mStringProperties[kDrmErrorTestKey] = kAidlDrmErrorTestValue;
    mStringProperties[kAidlVersionKey] = kAidlVersionValue;

    std::vector<uint8_t> valueVector;
    valueVector.clear();
@@ -377,6 +379,8 @@ void DrmPlugin::installSecureStop(const std::vector<uint8_t>& sessionId) {
        value = mStringProperties[kListenerTestSupportKey];
    } else if (name == kDrmErrorTestKey) {
        value = mStringProperties[kDrmErrorTestKey];
    } else if (name == kAidlVersionKey) {
        value = mStringProperties[kAidlVersionValue];
    } else {
        ALOGE("App requested unknown string property %s", name.c_str());
        status = Status::ERROR_DRM_CANNOT_HANDLE;
+34 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2022 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#ifndef AIDL_CLEARKEY_PROPERTIES_H
#define AIDL_CLEARKEY_PROPERTIES_H
#include <string>

namespace clearkeydrm {
static const std::string kAidlVendorValue("Google");
static const std::string kAidlVersionValue("1.0");
static const std::string kAidlPluginDescriptionValue("ClearKey CDM");
static const std::string kAidlAlgorithmsValue("");
static const std::string kAidlListenerTestSupportValue("true");

static const std::string kAidlDrmErrorTestValue("");
static const std::string kAidlResourceContentionValue("resourceContention");
static const std::string kAidlLostStateValue("lostState");
static const std::string kAidlFrameTooLargeValue("frameTooLarge");
static const std::string kAidlInvalidStateValue("invalidState");
}  // namespace clearkeydrm

#endif
 No newline at end of file
+1 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ static const std::string kResourceContentionValue("resourceContention");
static const std::string kLostStateValue("lostState");
static const std::string kFrameTooLargeValue("frameTooLarge");
static const std::string kInvalidStateValue("invalidState");
static const std::string kAidlVersionKey("aidlVersion");

static const std::string kDeviceIdKey("deviceId");
static const uint8_t kTestDeviceIdData[] = {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7,