Use aidl interface for Widevine service.
The interface is defined in hardware/interfaces/drm/aidl(http://go/ag/15329852). Test: build m android.hardware.drm-service.widevine -j128 Test: build_and_run_all_unit_tests.sh for hidl tests Test: atest VtsAidlHalDrmTargetTest Test: atest vts_treble_vintf_vendor_test:vts_treble_vintf_vendor_test.DeviceManifest/SingleManifestTest#ManifestAidlHalsServed/0 -- --abi x86_64 Bug: 200055138 Bug: 170964303 Change-Id: I5654d90d8a4b0bae4b4a78e79b27c1cafec36be7
This commit is contained in:
@@ -66,5 +66,48 @@ cc_library_static {
|
||||
],
|
||||
|
||||
proprietary: true,
|
||||
|
||||
}
|
||||
|
||||
// Builds libwvdrmdrmplugin_aidl
|
||||
//
|
||||
cc_library_static {
|
||||
name: "libwvdrmdrmplugin_aidl",
|
||||
|
||||
srcs: [
|
||||
"aidl_src/WVDrmPlugin.cpp",
|
||||
"aidl_src/WVGenericCryptoInterface.cpp",
|
||||
"aidl_src/wv_metrics_adapter.cpp",
|
||||
],
|
||||
|
||||
include_dirs: [
|
||||
"frameworks/av/include",
|
||||
"frameworks/native/include",
|
||||
"vendor/widevine/libwvdrmengine/cdm/core/include",
|
||||
"vendor/widevine/libwvdrmengine/cdm/include",
|
||||
"vendor/widevine/libwvdrmengine/cdm/metrics/include",
|
||||
"vendor/widevine/libwvdrmengine/cdm/util/include",
|
||||
"vendor/widevine/libwvdrmengine/aidl_include",
|
||||
"vendor/widevine/libwvdrmengine/include",
|
||||
"vendor/widevine/libwvdrmengine/mediadrm/aidl_include",
|
||||
"vendor/widevine/libwvdrmengine/oemcrypto/include",
|
||||
],
|
||||
|
||||
header_libs: [
|
||||
"libstagefright_headers",
|
||||
"libstagefright_foundation_headers",
|
||||
"libutils_headers",
|
||||
],
|
||||
|
||||
static_libs: ["libcdm_protos"],
|
||||
|
||||
shared_libs: [
|
||||
"libbase",
|
||||
"libbinder",
|
||||
"libbinder_ndk",
|
||||
"libcrypto",
|
||||
"liblog",
|
||||
"android.hardware.drm-V1-ndk",
|
||||
],
|
||||
|
||||
proprietary: true,
|
||||
}
|
||||
|
||||
465
libwvdrmengine/mediadrm/aidl_include/WVDrmPlugin.h
Normal file
465
libwvdrmengine/mediadrm/aidl_include/WVDrmPlugin.h
Normal file
@@ -0,0 +1,465 @@
|
||||
//
|
||||
// Copyright 2021 Google LLC. All Rights Reserved. This file and proprietary
|
||||
// source code may only be used and distributed under the Widevine License
|
||||
// Agreement.
|
||||
//
|
||||
|
||||
#ifndef WV_DRM_PLUGIN_H_
|
||||
#define WV_DRM_PLUGIN_H_
|
||||
|
||||
#include <aidl/android/hardware/drm/BnDrmPlugin.h>
|
||||
#include <aidl/android/hardware/drm/IDrmPluginListener.h>
|
||||
#include <aidl/android/hardware/drm/Status.h>
|
||||
#include <utils/Mutex.h>
|
||||
|
||||
#include <list>
|
||||
#include <map>
|
||||
|
||||
#include "OEMCryptoCENC.h"
|
||||
#include "WVGenericCryptoInterface.h"
|
||||
#include "WVTypes.h"
|
||||
#include "cdm_client_property_set.h"
|
||||
#include "cdm_identifier.h"
|
||||
#include "log.h"
|
||||
#include "wv_cdm_event_listener.h"
|
||||
#include "wv_content_decryption_module.h"
|
||||
|
||||
namespace wvdrm {
|
||||
namespace hardware {
|
||||
namespace drm {
|
||||
namespace widevine {
|
||||
|
||||
using ::aidl::android::hardware::drm::Status;
|
||||
|
||||
using wvcdm::CdmIdentifier;
|
||||
using wvcdm::CdmKeyStatusMap;
|
||||
using wvcdm::CdmResponseType;
|
||||
using wvcdm::CdmSessionId;
|
||||
using wvcdm::WvContentDecryptionModule;
|
||||
|
||||
const OEMCrypto_Algorithm kInvalidCryptoAlgorithm =
|
||||
static_cast<OEMCrypto_Algorithm>(-1);
|
||||
|
||||
struct WVDrmPlugin : public ::aidl::android::hardware::drm::BnDrmPlugin,
|
||||
wvcdm::WvCdmEventListener {
|
||||
WVDrmPlugin(const android::sp<WvContentDecryptionModule>& cdm,
|
||||
const std::string& appPackageName,
|
||||
WVGenericCryptoInterface* crypto, bool useSpoid);
|
||||
|
||||
virtual ~WVDrmPlugin();
|
||||
|
||||
void Close();
|
||||
|
||||
::ndk::ScopedAStatus closeSession(
|
||||
const std::vector<uint8_t>& in_sessionId) override;
|
||||
::ndk::ScopedAStatus decrypt(const std::vector<uint8_t>& in_sessionId,
|
||||
const std::vector<uint8_t>& in_keyId,
|
||||
const std::vector<uint8_t>& in_input,
|
||||
const std::vector<uint8_t>& in_iv,
|
||||
std::vector<uint8_t>* _aidl_return) override;
|
||||
::ndk::ScopedAStatus encrypt(const std::vector<uint8_t>& in_sessionId,
|
||||
const std::vector<uint8_t>& in_keyId,
|
||||
const std::vector<uint8_t>& in_input,
|
||||
const std::vector<uint8_t>& in_iv,
|
||||
std::vector<uint8_t>* _aidl_return) override;
|
||||
::ndk::ScopedAStatus getHdcpLevels(
|
||||
::aidl::android::hardware::drm::HdcpLevels* _aidl_return) override;
|
||||
::ndk::ScopedAStatus getKeyRequest(
|
||||
const std::vector<uint8_t>& in_scope,
|
||||
const std::vector<uint8_t>& in_initData, const std::string& in_mimeType,
|
||||
::aidl::android::hardware::drm::KeyType in_keyType,
|
||||
const std::vector<::aidl::android::hardware::drm::KeyValue>&
|
||||
in_optionalParameters,
|
||||
::aidl::android::hardware::drm::KeyRequest* _aidl_return) override;
|
||||
::ndk::ScopedAStatus getLogMessages(
|
||||
std::vector<::aidl::android::hardware::drm::LogMessage>* _aidl_return)
|
||||
override;
|
||||
::ndk::ScopedAStatus getMetrics(
|
||||
std::vector<::aidl::android::hardware::drm::DrmMetricGroup>* _aidl_return)
|
||||
override;
|
||||
::ndk::ScopedAStatus getNumberOfSessions(
|
||||
::aidl::android::hardware::drm::NumberOfSessions* _aidl_return) override;
|
||||
::ndk::ScopedAStatus getOfflineLicenseKeySetIds(
|
||||
std::vector<::aidl::android::hardware::drm::KeySetId>* _aidl_return)
|
||||
override;
|
||||
::ndk::ScopedAStatus getOfflineLicenseState(
|
||||
const ::aidl::android::hardware::drm::KeySetId& in_keySetId,
|
||||
::aidl::android::hardware::drm::OfflineLicenseState* _aidl_return)
|
||||
override;
|
||||
::ndk::ScopedAStatus getPropertyByteArray(
|
||||
const std::string& in_propertyName,
|
||||
std::vector<uint8_t>* _aidl_return) override;
|
||||
::ndk::ScopedAStatus getPropertyString(const std::string& in_propertyName,
|
||||
std::string* _aidl_return) override;
|
||||
::ndk::ScopedAStatus getProvisionRequest(
|
||||
const std::string& in_certificateType,
|
||||
const std::string& in_certificateAuthority,
|
||||
::aidl::android::hardware::drm::ProvisionRequest* _aidl_return) override;
|
||||
::ndk::ScopedAStatus getSecureStop(
|
||||
const ::aidl::android::hardware::drm::SecureStopId& in_secureStopId,
|
||||
::aidl::android::hardware::drm::SecureStop* _aidl_return) override;
|
||||
::ndk::ScopedAStatus getSecureStopIds(
|
||||
std::vector<::aidl::android::hardware::drm::SecureStopId>* _aidl_return)
|
||||
override;
|
||||
::ndk::ScopedAStatus getSecureStops(
|
||||
std::vector<::aidl::android::hardware::drm::SecureStop>* _aidl_return)
|
||||
override;
|
||||
::ndk::ScopedAStatus getSecurityLevel(
|
||||
const std::vector<uint8_t>& in_sessionId,
|
||||
::aidl::android::hardware::drm::SecurityLevel* _aidl_return) override;
|
||||
::ndk::ScopedAStatus openSession(
|
||||
::aidl::android::hardware::drm::SecurityLevel in_securityLevel,
|
||||
std::vector<uint8_t>* _aidl_return) override;
|
||||
::ndk::ScopedAStatus provideKeyResponse(
|
||||
const std::vector<uint8_t>& in_scope,
|
||||
const std::vector<uint8_t>& in_response,
|
||||
::aidl::android::hardware::drm::KeySetId* _aidl_return) override;
|
||||
::ndk::ScopedAStatus provideProvisionResponse(
|
||||
const std::vector<uint8_t>& in_response,
|
||||
::aidl::android::hardware::drm::ProvideProvisionResponseResult*
|
||||
_aidl_return) override;
|
||||
::ndk::ScopedAStatus queryKeyStatus(
|
||||
const std::vector<uint8_t>& in_sessionId,
|
||||
std::vector<::aidl::android::hardware::drm::KeyValue>* _aidl_return)
|
||||
override;
|
||||
::ndk::ScopedAStatus releaseAllSecureStops() override;
|
||||
::ndk::ScopedAStatus releaseSecureStop(
|
||||
const ::aidl::android::hardware::drm::SecureStopId& in_secureStopId)
|
||||
override;
|
||||
::ndk::ScopedAStatus releaseSecureStops(
|
||||
const ::aidl::android::hardware::drm::OpaqueData& in_ssRelease) override;
|
||||
::ndk::ScopedAStatus removeAllSecureStops() override;
|
||||
::ndk::ScopedAStatus removeKeys(
|
||||
const std::vector<uint8_t>& in_sessionId) override;
|
||||
::ndk::ScopedAStatus removeOfflineLicense(
|
||||
const ::aidl::android::hardware::drm::KeySetId& in_keySetId) override;
|
||||
::ndk::ScopedAStatus removeSecureStop(
|
||||
const ::aidl::android::hardware::drm::SecureStopId& in_secureStopId)
|
||||
override;
|
||||
::ndk::ScopedAStatus requiresSecureDecoder(
|
||||
const std::string& in_mime,
|
||||
::aidl::android::hardware::drm::SecurityLevel in_level,
|
||||
bool* _aidl_return) override;
|
||||
::ndk::ScopedAStatus requiresSecureDecoderDefault(
|
||||
const std::string& in_mime, bool* _aidl_return) override;
|
||||
::ndk::ScopedAStatus restoreKeys(
|
||||
const std::vector<uint8_t>& in_sessionId,
|
||||
const ::aidl::android::hardware::drm::KeySetId& in_keySetId) override;
|
||||
::ndk::ScopedAStatus setCipherAlgorithm(
|
||||
const std::vector<uint8_t>& in_sessionId,
|
||||
const std::string& in_algorithm) override;
|
||||
::ndk::ScopedAStatus setListener(
|
||||
const std::shared_ptr<::aidl::android::hardware::drm::IDrmPluginListener>&
|
||||
in_listener) override;
|
||||
::ndk::ScopedAStatus setMacAlgorithm(
|
||||
const std::vector<uint8_t>& in_sessionId,
|
||||
const std::string& in_algorithm) override;
|
||||
::ndk::ScopedAStatus setPlaybackId(const std::vector<uint8_t>& in_sessionId,
|
||||
const std::string& in_playbackId) override;
|
||||
::ndk::ScopedAStatus setPropertyByteArray(
|
||||
const std::string& in_propertyName,
|
||||
const std::vector<uint8_t>& in_value) override;
|
||||
::ndk::ScopedAStatus setPropertyString(const std::string& in_propertyName,
|
||||
const std::string& in_value) override;
|
||||
::ndk::ScopedAStatus sign(const std::vector<uint8_t>& in_sessionId,
|
||||
const std::vector<uint8_t>& in_keyId,
|
||||
const std::vector<uint8_t>& in_message,
|
||||
std::vector<uint8_t>* _aidl_return) override;
|
||||
::ndk::ScopedAStatus signRSA(const std::vector<uint8_t>& in_sessionId,
|
||||
const std::string& in_algorithm,
|
||||
const std::vector<uint8_t>& in_message,
|
||||
const std::vector<uint8_t>& in_wrappedkey,
|
||||
std::vector<uint8_t>* _aidl_return) override;
|
||||
::ndk::ScopedAStatus verify(const std::vector<uint8_t>& in_sessionId,
|
||||
const std::vector<uint8_t>& in_keyId,
|
||||
const std::vector<uint8_t>& in_message,
|
||||
const std::vector<uint8_t>& in_signature,
|
||||
bool* _aidl_return) override;
|
||||
|
||||
// The following methods do not use hidl interface, it is used internally.
|
||||
virtual Status unprovisionDevice();
|
||||
|
||||
virtual void OnSessionRenewalNeeded(const CdmSessionId& cdmSessionId);
|
||||
virtual void OnSessionKeysChange(const CdmSessionId& cdmSessionId,
|
||||
const CdmKeyStatusMap& cdmKeysStatus,
|
||||
bool hasNewUsableKey);
|
||||
virtual void OnExpirationUpdate(const CdmSessionId& cdmSessionId,
|
||||
int64_t newExpiryTimeSeconds);
|
||||
virtual void OnSessionLostState(const CdmSessionId& cdmSessionId);
|
||||
|
||||
private:
|
||||
WVDRM_DISALLOW_COPY_AND_ASSIGN_AND_NEW(WVDrmPlugin);
|
||||
|
||||
// List this field first so it is destructed last; ensure logging uid
|
||||
// is cleared right before plugin is destructed.
|
||||
wvutil::LoggingUidSetter mLoggingUidSetter;
|
||||
|
||||
struct CryptoSession {
|
||||
public:
|
||||
CryptoSession()
|
||||
: mOecSessionId(-1),
|
||||
mCipherAlgorithm(kInvalidCryptoAlgorithm),
|
||||
mMacAlgorithm(kInvalidCryptoAlgorithm) {}
|
||||
|
||||
CryptoSession(OEMCrypto_SESSION sessionId)
|
||||
: mOecSessionId(sessionId),
|
||||
mCipherAlgorithm(kInvalidCryptoAlgorithm),
|
||||
mMacAlgorithm(kInvalidCryptoAlgorithm) {}
|
||||
|
||||
OEMCrypto_SESSION oecSessionId() const { return mOecSessionId; }
|
||||
|
||||
OEMCrypto_Algorithm cipherAlgorithm() const { return mCipherAlgorithm; }
|
||||
|
||||
void setCipherAlgorithm(OEMCrypto_Algorithm newAlgorithm) {
|
||||
mCipherAlgorithm = newAlgorithm;
|
||||
}
|
||||
|
||||
OEMCrypto_Algorithm macAlgorithm() const { return mMacAlgorithm; }
|
||||
|
||||
void setMacAlgorithm(OEMCrypto_Algorithm newAlgorithm) {
|
||||
mMacAlgorithm = newAlgorithm;
|
||||
}
|
||||
|
||||
private:
|
||||
OEMCrypto_SESSION mOecSessionId;
|
||||
OEMCrypto_Algorithm mCipherAlgorithm;
|
||||
OEMCrypto_Algorithm mMacAlgorithm;
|
||||
};
|
||||
|
||||
class WVClientPropertySet : public wvcdm::CdmClientPropertySet {
|
||||
public:
|
||||
WVClientPropertySet()
|
||||
: mUsePrivacyMode(false),
|
||||
mShareKeys(false),
|
||||
mSessionSharingId(0),
|
||||
mUseAtscMode(false) {}
|
||||
|
||||
virtual ~WVClientPropertySet() {}
|
||||
|
||||
virtual const std::string& security_level() const { return mSecurityLevel; }
|
||||
|
||||
void set_security_level(const std::string& securityLevel) {
|
||||
mSecurityLevel = securityLevel;
|
||||
}
|
||||
|
||||
virtual bool use_privacy_mode() const { return mUsePrivacyMode; }
|
||||
|
||||
void set_use_privacy_mode(bool usePrivacyMode) {
|
||||
mUsePrivacyMode = usePrivacyMode;
|
||||
}
|
||||
|
||||
virtual const std::string& service_certificate() const {
|
||||
return mServiceCertificate;
|
||||
}
|
||||
|
||||
virtual void set_service_certificate(
|
||||
const std::string& serviceCertificate) {
|
||||
mServiceCertificate = serviceCertificate;
|
||||
}
|
||||
|
||||
virtual const std::string& device_provisioning_service_certificate() const {
|
||||
// Android does not support service certificates for provisioning.
|
||||
return mEmptyString;
|
||||
}
|
||||
|
||||
virtual void set_device_provisioning_service_certificate(
|
||||
const std::string&) {
|
||||
// Ignore. Android does not support service certificates for provisioning
|
||||
// TODO(b/69562876): Android SHOULD support service cert for provisioning
|
||||
}
|
||||
|
||||
virtual bool is_session_sharing_enabled() const { return mShareKeys; }
|
||||
|
||||
void set_is_session_sharing_enabled(bool shareKeys) {
|
||||
mShareKeys = shareKeys;
|
||||
}
|
||||
|
||||
virtual uint32_t session_sharing_id() const { return mSessionSharingId; }
|
||||
|
||||
virtual void set_session_sharing_id(uint32_t id) { mSessionSharingId = id; }
|
||||
|
||||
virtual const std::string& app_id() const { return mAppId; }
|
||||
|
||||
void set_app_id(const std::string& appId) { mAppId = appId; }
|
||||
|
||||
virtual bool use_atsc_mode() const { return mUseAtscMode; }
|
||||
|
||||
void set_use_atsc_mode(bool useAtscMode) { mUseAtscMode = useAtscMode; }
|
||||
|
||||
private:
|
||||
DISALLOW_EVIL_CONSTRUCTORS(WVClientPropertySet);
|
||||
|
||||
std::string mSecurityLevel;
|
||||
bool mUsePrivacyMode;
|
||||
std::string mServiceCertificate;
|
||||
bool mShareKeys;
|
||||
uint32_t mSessionSharingId;
|
||||
std::string mAppId;
|
||||
bool mUseAtscMode;
|
||||
const std::string mEmptyString;
|
||||
} mPropertySet;
|
||||
|
||||
class CdmIdentifierBuilder {
|
||||
public:
|
||||
CdmIdentifierBuilder(bool useSpoid, const WVDrmPlugin& parent,
|
||||
const std::string& appPackageName);
|
||||
|
||||
// Fills in the passed-in struct with the CDM Identifier for the current
|
||||
// combination of Origin, Application, and Device. This is needed by some
|
||||
// calls into the CDM in order to identify which CDM instance should receive
|
||||
// the call. Calling this will seal the CDM Identifier Builder, thus making
|
||||
// it an error to change the origin.
|
||||
Status getCdmIdentifier(CdmIdentifier* identifier);
|
||||
|
||||
// Gets the application-safe device-unique ID. On non-SPOID devices, this is
|
||||
// the device-unique ID from OEMCrypto. On SPOID devices, this is the SPOID.
|
||||
// On SPOID devices, calling this will seal the CDM Identifier Builder, thus
|
||||
// making it an error to change the origin.
|
||||
Status getDeviceUniqueId(std::string* id);
|
||||
Status getProvisioningUniqueId(std::string* id);
|
||||
|
||||
const std::string& origin() const { return mCdmIdentifier.origin; }
|
||||
bool set_origin(const std::string& id);
|
||||
|
||||
// This sets the app package name to allow apps to access ATSC licenses
|
||||
bool set_use_atsc_mode(bool enable);
|
||||
|
||||
// Indicates whether the builder can still be modified. This returns false
|
||||
// until a call to getCdmIdentifier.
|
||||
bool is_sealed() { return mIsIdentifierSealed; }
|
||||
|
||||
uint32_t user_id() const { return mCdmIdentifier.user_id; }
|
||||
|
||||
private:
|
||||
WVDRM_DISALLOW_COPY_AND_ASSIGN(CdmIdentifierBuilder);
|
||||
|
||||
CdmIdentifier mCdmIdentifier;
|
||||
bool mIsIdentifierSealed;
|
||||
|
||||
bool mUseSpoid;
|
||||
std::string mAppPackageName;
|
||||
const WVDrmPlugin& mParent;
|
||||
|
||||
Status calculateSpoid();
|
||||
Status calculateSpoid(const std::string& deviceID, std::string* spoid);
|
||||
|
||||
// Gets the device-unique ID from OEMCrypto. This must be private, since
|
||||
// this value must not be exposed to applications on SPOID devices. Code
|
||||
// outside this class should use getDeviceUniqueId() to get the
|
||||
// application-safe device-unique ID.
|
||||
Status getOemcryptoDeviceId(std::string* id);
|
||||
Status getOemcryptoDeviceId(wvcdm::RequestedSecurityLevel securityLevel,
|
||||
std::string* id);
|
||||
|
||||
// The unique identifier is meant to ensure that two clients with the
|
||||
// same spoid, origin and app package name still get different cdm engine
|
||||
// instances. This is a stepping stone to simplifying the implementation.
|
||||
// Note that we do not have a lock or mutex around this object. We assume
|
||||
// that locking is handled external to this object.
|
||||
uint32_t getNextUniqueId();
|
||||
} mCdmIdentifierBuilder;
|
||||
|
||||
// Properly close plugins on SIGTERM then exit
|
||||
class Terminator {
|
||||
public:
|
||||
static void Register(WVDrmPlugin* plugin) { instance().DoRegister(plugin); }
|
||||
static void Forget(WVDrmPlugin* plugin) { instance().DoForget(plugin); }
|
||||
static void Terminate(int /*signal*/) { instance().DoTerminate(); }
|
||||
|
||||
private:
|
||||
WVDRM_DISALLOW_COPY_AND_ASSIGN(Terminator);
|
||||
|
||||
Terminator() { signal(SIGTERM, Terminate); }
|
||||
|
||||
static Terminator& instance() {
|
||||
static Terminator instance;
|
||||
return instance;
|
||||
}
|
||||
|
||||
void DoRegister(WVDrmPlugin* plugin) {
|
||||
android::Mutex::Autolock lock(mLock);
|
||||
mPlugins.push_back(plugin);
|
||||
}
|
||||
|
||||
void DoForget(WVDrmPlugin* plugin) {
|
||||
android::Mutex::Autolock lock(mLock);
|
||||
mPlugins.remove(plugin);
|
||||
}
|
||||
|
||||
void DoTerminate() {
|
||||
android::Mutex::Autolock lock(mLock);
|
||||
for_each(mPlugins.begin(), mPlugins.end(),
|
||||
[](WVDrmPlugin* plugin) { plugin->Close(); });
|
||||
exit(0);
|
||||
}
|
||||
|
||||
std::list<WVDrmPlugin*> mPlugins;
|
||||
android::Mutex mLock;
|
||||
};
|
||||
|
||||
android::sp<wvcdm::WvContentDecryptionModule> const mCDM;
|
||||
WVGenericCryptoInterface* mCrypto;
|
||||
std::map<CdmSessionId, CryptoSession> mCryptoSessions;
|
||||
std::shared_ptr<::aidl::android::hardware::drm::IDrmPluginListener> mListener;
|
||||
|
||||
std::string mProvisioningServiceCertificate;
|
||||
|
||||
wvcdm::CdmSessionId mDecryptHashSessionId;
|
||||
|
||||
std::string mAppPackageName;
|
||||
|
||||
Status queryProperty(const std::string& property,
|
||||
std::string& stringValue) const;
|
||||
|
||||
Status queryProperty(wvcdm::RequestedSecurityLevel securityLevel,
|
||||
const std::string& property,
|
||||
std::string& stringValue) const;
|
||||
|
||||
Status queryProperty(const std::string& property,
|
||||
std::vector<uint8_t>& vector_value) const;
|
||||
|
||||
bool isProvisioned(wvcdm::CdmSecurityLevel securityLevel,
|
||||
const std::string& origin, const std::string& spoid,
|
||||
bool atsc_mode_enabled) const;
|
||||
|
||||
Status mapAndNotifyOfCdmResponseType(const std::vector<uint8_t>& sessionId,
|
||||
CdmResponseType res);
|
||||
|
||||
void notifyOfCdmResponseType(const std::vector<uint8_t>& sessionId,
|
||||
CdmResponseType res);
|
||||
|
||||
Status mapAndNotifyOfOEMCryptoResult(const std::vector<uint8_t>& sessionId,
|
||||
OEMCryptoResult res);
|
||||
|
||||
Status mapOEMCryptoResult(OEMCryptoResult res);
|
||||
|
||||
::aidl::android::hardware::drm::SecurityLevel mapSecurityLevel(
|
||||
const std::string& level);
|
||||
|
||||
wvcdm::RequestedSecurityLevel getRequestedSecurityLevel() const;
|
||||
|
||||
Status openSessionCommon(std::vector<uint8_t>& sessionId);
|
||||
|
||||
bool initDataResemblesPSSH(const std::vector<uint8_t>& initData);
|
||||
|
||||
Status unprovision(const CdmIdentifier& identifier);
|
||||
|
||||
void sendEvent(::aidl::android::hardware::drm::EventType in_eventType,
|
||||
const std::vector<uint8_t>& in_sessionId,
|
||||
const std::vector<uint8_t>& in_data);
|
||||
void sendExpirationUpdate(const std::vector<uint8_t>& in_sessionId,
|
||||
int64_t in_expiryTimeInMS);
|
||||
void sendKeysChange(
|
||||
const std::vector<uint8_t>& in_sessionId,
|
||||
const std::vector<::aidl::android::hardware::drm::KeyStatus>&
|
||||
in_keyStatusList,
|
||||
bool in_hasNewUsableKey);
|
||||
void sendSessionLostState(const std::vector<uint8_t>& in_sessionId);
|
||||
};
|
||||
|
||||
} // namespace widevine
|
||||
} // namespace drm
|
||||
} // namespace hardware
|
||||
} // namespace wvdrm
|
||||
|
||||
#endif // WV_DRM_PLUGIN_H_
|
||||
@@ -0,0 +1,94 @@
|
||||
//
|
||||
// Copyright 2021 Google LLC. All Rights Reserved. This file and proprietary
|
||||
// source code may only be used and distributed under the Widevine License
|
||||
// Agreement.
|
||||
//
|
||||
|
||||
#ifndef WV_GENERIC_CRYPTO_INTERFACE_H_
|
||||
#define WV_GENERIC_CRYPTO_INTERFACE_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "OEMCryptoCENC.h"
|
||||
#include "media/stagefright/foundation/ABase.h"
|
||||
|
||||
namespace wvdrm {
|
||||
|
||||
class WVGenericCryptoInterface {
|
||||
public:
|
||||
WVGenericCryptoInterface() {}
|
||||
virtual ~WVGenericCryptoInterface() {}
|
||||
|
||||
virtual OEMCryptoResult selectKey(const OEMCrypto_SESSION session,
|
||||
const uint8_t* key_id,
|
||||
size_t key_id_length) {
|
||||
return OEMCrypto_SelectKey(session, key_id, key_id_length,
|
||||
OEMCrypto_CipherMode_CBC);
|
||||
}
|
||||
|
||||
virtual OEMCryptoResult encrypt(OEMCrypto_SESSION session,
|
||||
const uint8_t* in_buffer,
|
||||
size_t buffer_length, const uint8_t* iv,
|
||||
OEMCrypto_Algorithm algorithm,
|
||||
uint8_t* out_buffer) {
|
||||
return OEMCrypto_Generic_Encrypt(session, in_buffer, buffer_length, iv,
|
||||
algorithm, out_buffer);
|
||||
}
|
||||
|
||||
virtual OEMCryptoResult decrypt(OEMCrypto_SESSION session,
|
||||
const uint8_t* in_buffer,
|
||||
size_t buffer_length, const uint8_t* iv,
|
||||
OEMCrypto_Algorithm algorithm,
|
||||
uint8_t* out_buffer) {
|
||||
return OEMCrypto_Generic_Decrypt(session, in_buffer, buffer_length, iv,
|
||||
algorithm, out_buffer);
|
||||
}
|
||||
|
||||
virtual OEMCryptoResult sign(OEMCrypto_SESSION session,
|
||||
const uint8_t* in_buffer, size_t buffer_length,
|
||||
OEMCrypto_Algorithm algorithm,
|
||||
uint8_t* signature, size_t* signature_length) {
|
||||
return OEMCrypto_Generic_Sign(session, in_buffer, buffer_length, algorithm,
|
||||
signature, signature_length);
|
||||
}
|
||||
|
||||
virtual OEMCryptoResult verify(OEMCrypto_SESSION session,
|
||||
const uint8_t* in_buffer, size_t buffer_length,
|
||||
OEMCrypto_Algorithm algorithm,
|
||||
const uint8_t* signature,
|
||||
size_t signature_length) {
|
||||
return OEMCrypto_Generic_Verify(session, in_buffer, buffer_length,
|
||||
algorithm, signature, signature_length);
|
||||
}
|
||||
|
||||
virtual OEMCryptoResult signRSA(const uint8_t* wrapped_rsa_key,
|
||||
size_t wrapped_rsa_key_length,
|
||||
const uint8_t* message, size_t message_length,
|
||||
std::vector<uint8_t>& signature,
|
||||
RSA_Padding_Scheme padding_scheme);
|
||||
|
||||
virtual OEMCryptoResult loadDeviceRSAKey(OEMCrypto_SESSION session,
|
||||
const uint8_t* wrapped_rsa_key,
|
||||
size_t wrapped_rsa_key_length) {
|
||||
return OEMCrypto_LoadDRMPrivateKey(session, OEMCrypto_RSA_Private_Key,
|
||||
wrapped_rsa_key, wrapped_rsa_key_length);
|
||||
}
|
||||
|
||||
virtual OEMCryptoResult generateRSASignature(
|
||||
OEMCrypto_SESSION session, const uint8_t* message, size_t message_length,
|
||||
uint8_t* signature, size_t* signature_length,
|
||||
RSA_Padding_Scheme padding_scheme) {
|
||||
return OEMCrypto_GenerateRSASignature(session, message, message_length,
|
||||
signature, signature_length,
|
||||
padding_scheme);
|
||||
}
|
||||
|
||||
private:
|
||||
DISALLOW_EVIL_CONSTRUCTORS(WVGenericCryptoInterface);
|
||||
};
|
||||
|
||||
} // namespace wvdrm
|
||||
|
||||
#endif // WV_GENERIC_CRYPTO_INTERFACE_H_
|
||||
108
libwvdrmengine/mediadrm/aidl_include/wv_metrics_adapter.h
Normal file
108
libwvdrmengine/mediadrm/aidl_include/wv_metrics_adapter.h
Normal file
@@ -0,0 +1,108 @@
|
||||
//
|
||||
// Copyright 2021 Google LLC. All Rights Reserved. This file and proprietary
|
||||
// source code may only be used and distributed under the Widevine License
|
||||
// Agreement.
|
||||
//
|
||||
|
||||
#ifndef WV_METRICS_ADAPTER_H_
|
||||
#define WV_METRICS_ADAPTER_H_
|
||||
|
||||
#include <aidl/android/hardware/drm/DrmMetricGroup.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "wv_metrics.pb.h"
|
||||
|
||||
namespace wvcdm {
|
||||
|
||||
class WvMetricsAdapter;
|
||||
|
||||
// This class is used to convert from the metrics.proto format for metrics
|
||||
// to the format specified in the aidl.android.hardware.drm DrmMetricGroup
|
||||
// type. This class converts the common metric types into a single group.
|
||||
//
|
||||
// Example:
|
||||
// drm_metrics::DistributionMetric distribution;
|
||||
// distribution.set_operation_count(1);
|
||||
// WvMetricsGroupBuilder builder;
|
||||
// builder.AddDistributions("test distribution", { distribution });
|
||||
//
|
||||
// DrmMetricGroup group = builder.Build();
|
||||
class WvMetricsGroupBuilder {
|
||||
public:
|
||||
// Adds a group of distributions with the given base name.
|
||||
void AddDistributions(
|
||||
const std::string& name,
|
||||
const google::protobuf::RepeatedPtrField<drm_metrics::DistributionMetric>&
|
||||
distributions);
|
||||
|
||||
// Adds a group of counter metrics with the given base name.
|
||||
void AddCounters(
|
||||
const std::string& name,
|
||||
const google::protobuf::RepeatedPtrField<drm_metrics::CounterMetric>&
|
||||
counters);
|
||||
|
||||
// Adds a value metric.
|
||||
void AddValue(const std::string& name,
|
||||
const drm_metrics::ValueMetric& value_or_error);
|
||||
|
||||
// Builds the metric group containing all of the previously added metrics.
|
||||
::aidl::android::hardware::drm::DrmMetricGroup Build();
|
||||
|
||||
private:
|
||||
friend class WvMetricsAdapter;
|
||||
std::vector<::aidl::android::hardware::drm::DrmMetric> metrics_;
|
||||
|
||||
WvMetricsGroupBuilder();
|
||||
// Adds a distribution with the given name and distribution values.
|
||||
void AddDistribution(const std::string& name,
|
||||
const drm_metrics::DistributionMetric& distribution);
|
||||
// Adds a counter metric
|
||||
void AddCounter(const std::string& name,
|
||||
const drm_metrics::CounterMetric& counter);
|
||||
void AddAttributes(
|
||||
const drm_metrics::Attributes& attributes_proto,
|
||||
std::vector<::aidl::android::hardware::drm::DrmMetricNamedValue>*
|
||||
attributes);
|
||||
};
|
||||
|
||||
// This class handles adding the engine and session metric collections. This
|
||||
// will generate one DrmMetricGroup for each EngineMetric added and one for
|
||||
// each SessionMetric added. This class also supports a static utility method to
|
||||
// convert a WvCdmMetrics proto to a vector of DrmMetricGroup instances.
|
||||
class WvMetricsAdapter {
|
||||
public:
|
||||
// Utility method to quickly convert a WvCdmMetrics proto to a DrmMetricGroup
|
||||
// vector.
|
||||
static void ToWvMetrics(
|
||||
const drm_metrics::WvCdmMetrics& proto_metrics,
|
||||
std::vector<::aidl::android::hardware::drm::DrmMetricGroup>* wv_metrics);
|
||||
|
||||
WvMetricsAdapter();
|
||||
~WvMetricsAdapter();
|
||||
|
||||
// Adds the EngineMetrics instance to the Adapter. It will be converted and
|
||||
// stored. The converted metrics can be fetched via GetWvGroupVector.
|
||||
void AddEngineMetrics(
|
||||
const drm_metrics::WvCdmMetrics::EngineMetrics& proto_metrics);
|
||||
|
||||
// Adds the SessionMetrics instance to the Adapter. It will be converted and
|
||||
// stored. The converted metrics can be fetched via GetWvGroupVector.
|
||||
void AddSessionMetrics(
|
||||
const drm_metrics::WvCdmMetrics::SessionMetrics& proto_metrics);
|
||||
|
||||
// Returns the converted DrmMetricGroup vector containing all of the
|
||||
// previously added engine and session metrics collections.
|
||||
const std::vector<::aidl::android::hardware::drm::DrmMetricGroup>
|
||||
GetWvGroupVector();
|
||||
|
||||
private:
|
||||
void AddCryptoMetrics(
|
||||
const drm_metrics::WvCdmMetrics::CryptoMetrics& proto_metrics,
|
||||
WvMetricsGroupBuilder* group_builder);
|
||||
std::vector<::aidl::android::hardware::drm::DrmMetricGroup> group_vector_;
|
||||
};
|
||||
|
||||
} // namespace wvcdm
|
||||
|
||||
#endif // WV_METRICS_ADAPTER_H_
|
||||
2163
libwvdrmengine/mediadrm/aidl_src/WVDrmPlugin.cpp
Normal file
2163
libwvdrmengine/mediadrm/aidl_src/WVDrmPlugin.cpp
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// Copyright 2021 Google LLC. All Rights Reserved. This file and proprietary
|
||||
// source code may only be used and distributed under the Widevine License
|
||||
// Agreement.
|
||||
//
|
||||
|
||||
//#define LOG_NDEBUG 0
|
||||
#define LOG_TAG "WVCdm"
|
||||
#include <log/log.h>
|
||||
|
||||
#include "WVGenericCryptoInterface.h"
|
||||
|
||||
#include "wv_cdm_constants.h"
|
||||
|
||||
namespace wvdrm {
|
||||
|
||||
using namespace std;
|
||||
using namespace wvcdm;
|
||||
|
||||
OEMCryptoResult WVGenericCryptoInterface::signRSA(const uint8_t* wrapped_rsa_key,
|
||||
size_t wrapped_rsa_key_length,
|
||||
const uint8_t* message,
|
||||
size_t message_length,
|
||||
std::vector<uint8_t>& signature,
|
||||
RSA_Padding_Scheme padding_scheme) {
|
||||
OEMCrypto_SESSION session;
|
||||
OEMCryptoResult sts = OEMCrypto_OpenSession(&session);
|
||||
if (sts != OEMCrypto_SUCCESS) return sts;
|
||||
sts = OEMCrypto_LoadDRMPrivateKey(session, OEMCrypto_RSA_Private_Key,
|
||||
wrapped_rsa_key, wrapped_rsa_key_length);
|
||||
if (sts == OEMCrypto_SUCCESS) {
|
||||
size_t signatureSize = 0;
|
||||
sts = OEMCrypto_GenerateRSASignature(session, message, message_length,
|
||||
NULL, &signatureSize,
|
||||
padding_scheme);
|
||||
if (sts == OEMCrypto_SUCCESS) {
|
||||
// Should be short buffer.
|
||||
sts = OEMCrypto_ERROR_UNKNOWN_FAILURE;
|
||||
} else if (sts == OEMCrypto_ERROR_SHORT_BUFFER) {
|
||||
signature.resize(signatureSize);
|
||||
sts = OEMCrypto_GenerateRSASignature(session, message, message_length,
|
||||
signature.data(), &signatureSize,
|
||||
padding_scheme);
|
||||
}
|
||||
}
|
||||
OEMCrypto_CloseSession(session);
|
||||
return sts;
|
||||
}
|
||||
|
||||
} // namespace wvdrm
|
||||
595
libwvdrmengine/mediadrm/aidl_src/wv_metrics_adapter.cpp
Normal file
595
libwvdrmengine/mediadrm/aidl_src/wv_metrics_adapter.cpp
Normal file
@@ -0,0 +1,595 @@
|
||||
//
|
||||
// Copyright 2021 Google LLC. All Rights Reserved. This file and proprietary
|
||||
// source code may only be used and distributed under the Widevine License
|
||||
// Agreement.
|
||||
//
|
||||
|
||||
#include "wv_metrics_adapter.h"
|
||||
|
||||
#include "wv_metrics.pb.h"
|
||||
|
||||
namespace wvcdm {
|
||||
|
||||
using ::aidl::android::hardware::drm::DrmMetric;
|
||||
using ::aidl::android::hardware::drm::DrmMetricGroup;
|
||||
using ::aidl::android::hardware::drm::DrmMetricNamedValue;
|
||||
using ::aidl::android::hardware::drm::DrmMetricValue;
|
||||
|
||||
using drm_metrics::CounterMetric;
|
||||
using drm_metrics::DistributionMetric;
|
||||
using google::protobuf::RepeatedPtrField;
|
||||
|
||||
namespace {
|
||||
|
||||
const char kAttributeErrorCode[] = "error_code";
|
||||
const char kAttributeErrorCodeBool[] = "error_code_bool";
|
||||
const char kAttributeCdmSecurityLevel[] = "cdm_security_level";
|
||||
const char kAttributeSecurityLevel[] = "security_level";
|
||||
const char kAttributeLength[] = "length";
|
||||
const char kAttributeEncryptionAlgorithm[] = "encryption_algorithm";
|
||||
const char kAttributeSigningAlgorithm[] = "signing_algorithm";
|
||||
const char kAttributeOemCryptoResult[] = "oem_crypto_result";
|
||||
const char kAttributeKeyStatusType[] = "key_status_type";
|
||||
const char kAttributeEventType[] = "event_type";
|
||||
const char kAttributeKeyRequestType[] = "key_request_type";
|
||||
const char kAttributeLicenseType[] = "license_type";
|
||||
|
||||
template <typename T>
|
||||
void SetValue(const T& value, DrmMetricNamedValue* attribute);
|
||||
|
||||
template <>
|
||||
void SetValue(const int& value, DrmMetricNamedValue* attribute) {
|
||||
attribute->value = DrmMetricValue::make<DrmMetricValue::int64Value>(value);
|
||||
}
|
||||
template <>
|
||||
void SetValue(const bool& value, DrmMetricNamedValue* attribute) {
|
||||
attribute->value = DrmMetricValue::make<DrmMetricValue::int64Value>(value);
|
||||
}
|
||||
template <>
|
||||
void SetValue(const float& value, DrmMetricNamedValue* attribute) {
|
||||
attribute->value = DrmMetricValue::make<DrmMetricValue::doubleValue>(value);
|
||||
}
|
||||
template <>
|
||||
void SetValue(const double& value, DrmMetricNamedValue* attribute) {
|
||||
attribute->value = DrmMetricValue::make<DrmMetricValue::doubleValue>(value);
|
||||
}
|
||||
template <>
|
||||
__attribute__((unused)) void SetValue(const long& value,
|
||||
DrmMetricNamedValue* attribute) {
|
||||
attribute->value = DrmMetricValue::make<DrmMetricValue::int64Value>(value);
|
||||
}
|
||||
template <>
|
||||
__attribute__((unused)) void SetValue(const long long& value,
|
||||
DrmMetricNamedValue* attribute) {
|
||||
attribute->value = DrmMetricValue::make<DrmMetricValue::int64Value>(value);
|
||||
}
|
||||
template <>
|
||||
void SetValue(const std::string& value, DrmMetricNamedValue* attribute) {
|
||||
attribute->value = DrmMetricValue::make<DrmMetricValue::stringValue>(value);
|
||||
}
|
||||
template <>
|
||||
void SetValue(const unsigned int& value, DrmMetricNamedValue* attribute) {
|
||||
attribute->value = DrmMetricValue::make<DrmMetricValue::int64Value>(value);
|
||||
}
|
||||
template <>
|
||||
__attribute__((unused)) void SetValue(const unsigned long& value,
|
||||
DrmMetricNamedValue* attribute) {
|
||||
attribute->value = DrmMetricValue::make<DrmMetricValue::int64Value>(value);
|
||||
}
|
||||
template <>
|
||||
__attribute__((unused)) void SetValue(const unsigned long long& value,
|
||||
DrmMetricNamedValue* attribute) {
|
||||
attribute->value = DrmMetricValue::make<DrmMetricValue::int64Value>(value);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void AddAttribute(const std::string& name, T value,
|
||||
std::vector<DrmMetricNamedValue>* attribute_vector) {
|
||||
// Set the default values.
|
||||
DrmMetricNamedValue attribute;
|
||||
attribute.name = name;
|
||||
SetValue(value, &attribute);
|
||||
attribute_vector->push_back(attribute);
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
void WvMetricsGroupBuilder::AddDistributions(
|
||||
const std::string& name,
|
||||
const RepeatedPtrField<drm_metrics::DistributionMetric>& distributions) {
|
||||
for (const auto& metric : distributions) {
|
||||
AddDistribution(name, metric);
|
||||
}
|
||||
}
|
||||
|
||||
void WvMetricsGroupBuilder::AddCounters(
|
||||
const std::string& name,
|
||||
const RepeatedPtrField<drm_metrics::CounterMetric>& counters) {
|
||||
for (const auto& counter : counters) {
|
||||
AddCounter(name, counter);
|
||||
}
|
||||
}
|
||||
|
||||
void WvMetricsGroupBuilder::AddDistribution(
|
||||
const std::string& name,
|
||||
const drm_metrics::DistributionMetric& distribution) {
|
||||
DrmMetric metric;
|
||||
metric.name = name;
|
||||
AddAttributes(distribution.attributes(), &(metric.attributes));
|
||||
|
||||
DrmMetricNamedValue mean, count;
|
||||
mean.name = "mean";
|
||||
SetValue(distribution.mean(), &mean);
|
||||
count.name = "count";
|
||||
SetValue(distribution.operation_count(), &count);
|
||||
|
||||
if (distribution.operation_count() == 1) {
|
||||
metric.values.resize(2);
|
||||
metric.values[0] = mean;
|
||||
metric.values[1] = count;
|
||||
} else {
|
||||
DrmMetricNamedValue min, max, variance;
|
||||
min.name = "min";
|
||||
SetValue(distribution.min(), &min);
|
||||
max.name = "max";
|
||||
SetValue(distribution.max(), &max);
|
||||
variance.name = "variance";
|
||||
SetValue(distribution.variance(), &variance);
|
||||
metric.values.resize(5);
|
||||
metric.values[0] = mean;
|
||||
metric.values[1] = count;
|
||||
metric.values[2] = min;
|
||||
metric.values[3] = max;
|
||||
metric.values[4] = variance;
|
||||
}
|
||||
metrics_.push_back(metric);
|
||||
}
|
||||
|
||||
void WvMetricsGroupBuilder::AddCounter(
|
||||
const std::string& name, const drm_metrics::CounterMetric& counter) {
|
||||
DrmMetric metric;
|
||||
metric.name = name;
|
||||
AddAttributes(counter.attributes(), &(metric.attributes));
|
||||
|
||||
DrmMetricNamedValue count;
|
||||
count.name = "count";
|
||||
SetValue(counter.count(), &count);
|
||||
|
||||
metric.values.resize(1);
|
||||
metric.values[0] = count;
|
||||
metrics_.push_back(metric);
|
||||
}
|
||||
|
||||
void WvMetricsGroupBuilder::AddValue(
|
||||
const std::string& name, const drm_metrics::ValueMetric& value_or_error) {
|
||||
DrmMetric metric;
|
||||
DrmMetricNamedValue value;
|
||||
|
||||
metric.name = name;
|
||||
if (value_or_error.has_error_code()) {
|
||||
value.name = "error_code";
|
||||
SetValue(value_or_error.error_code(), &value);
|
||||
} else if (value_or_error.has_int_value()) {
|
||||
value.name = "value";
|
||||
SetValue(value_or_error.int_value(), &value);
|
||||
} else if (value_or_error.has_double_value()) {
|
||||
value.name = "value";
|
||||
SetValue(value_or_error.double_value(), &value);
|
||||
} else if (value_or_error.has_string_value()) {
|
||||
value.name = "value";
|
||||
SetValue(value_or_error.string_value(), &value);
|
||||
} else {
|
||||
value.name = "error";
|
||||
SetValue(std::string("Unexpected value type"), &value);
|
||||
}
|
||||
metric.values.resize(1);
|
||||
metric.values[0] = value;
|
||||
metrics_.push_back(metric);
|
||||
}
|
||||
|
||||
void WvMetricsGroupBuilder::AddAttributes(
|
||||
const drm_metrics::Attributes& attributes_proto,
|
||||
std::vector<DrmMetricNamedValue>* attributes) {
|
||||
std::vector<DrmMetricNamedValue> attribute_vector;
|
||||
if (attributes_proto.has_error_code()) {
|
||||
AddAttribute(kAttributeErrorCode, attributes_proto.error_code(),
|
||||
&attribute_vector);
|
||||
}
|
||||
if (attributes_proto.has_error_code_bool()) {
|
||||
AddAttribute(kAttributeErrorCodeBool, attributes_proto.error_code_bool(),
|
||||
&attribute_vector);
|
||||
}
|
||||
if (attributes_proto.has_cdm_security_level()) {
|
||||
AddAttribute(kAttributeCdmSecurityLevel,
|
||||
attributes_proto.cdm_security_level(), &attribute_vector);
|
||||
}
|
||||
if (attributes_proto.has_security_level()) {
|
||||
AddAttribute(kAttributeSecurityLevel, attributes_proto.security_level(),
|
||||
&attribute_vector);
|
||||
}
|
||||
if (attributes_proto.has_length()) {
|
||||
AddAttribute(kAttributeLength, attributes_proto.length(),
|
||||
&attribute_vector);
|
||||
}
|
||||
if (attributes_proto.has_encryption_algorithm()) {
|
||||
AddAttribute(kAttributeEncryptionAlgorithm,
|
||||
attributes_proto.encryption_algorithm(), &attribute_vector);
|
||||
}
|
||||
if (attributes_proto.has_signing_algorithm()) {
|
||||
AddAttribute(kAttributeSigningAlgorithm,
|
||||
attributes_proto.signing_algorithm(), &attribute_vector);
|
||||
}
|
||||
if (attributes_proto.has_oem_crypto_result()) {
|
||||
AddAttribute(kAttributeOemCryptoResult,
|
||||
attributes_proto.oem_crypto_result(), &attribute_vector);
|
||||
}
|
||||
if (attributes_proto.has_key_status_type()) {
|
||||
AddAttribute(kAttributeKeyStatusType, attributes_proto.key_status_type(),
|
||||
&attribute_vector);
|
||||
}
|
||||
if (attributes_proto.has_event_type()) {
|
||||
AddAttribute(kAttributeEventType, attributes_proto.event_type(),
|
||||
&attribute_vector);
|
||||
}
|
||||
if (attributes_proto.has_key_request_type()) {
|
||||
AddAttribute(kAttributeKeyRequestType, attributes_proto.key_request_type(),
|
||||
&attribute_vector);
|
||||
}
|
||||
if (attributes_proto.has_license_type()) {
|
||||
AddAttribute(kAttributeLicenseType, attributes_proto.license_type(),
|
||||
&attribute_vector);
|
||||
}
|
||||
|
||||
*attributes = attribute_vector;
|
||||
}
|
||||
|
||||
DrmMetricGroup WvMetricsGroupBuilder::Build() {
|
||||
DrmMetricGroup metric_group;
|
||||
metric_group.metrics = metrics_;
|
||||
return metric_group;
|
||||
}
|
||||
|
||||
WvMetricsGroupBuilder::WvMetricsGroupBuilder() {}
|
||||
|
||||
WvMetricsAdapter::WvMetricsAdapter() {}
|
||||
WvMetricsAdapter::~WvMetricsAdapter() {}
|
||||
|
||||
void WvMetricsAdapter::AddEngineMetrics(
|
||||
const drm_metrics::WvCdmMetrics::EngineMetrics& proto_metrics) {
|
||||
WvMetricsGroupBuilder group_builder;
|
||||
AddCryptoMetrics(proto_metrics.crypto_metrics(), &group_builder);
|
||||
|
||||
if (proto_metrics.has_oemcrypto_initialization_mode()) {
|
||||
group_builder.AddValue("oemcrypto_initialization_mode",
|
||||
proto_metrics.oemcrypto_initialization_mode());
|
||||
}
|
||||
if (proto_metrics.has_oemcrypto_l1_api_version()) {
|
||||
group_builder.AddValue("oemcrypto_l1_api_version",
|
||||
proto_metrics.oemcrypto_l1_api_version());
|
||||
}
|
||||
if (proto_metrics.has_oemcrypto_l1_min_api_version()) {
|
||||
group_builder.AddValue("oemcrypto_l1_min_api_version",
|
||||
proto_metrics.oemcrypto_l1_min_api_version());
|
||||
}
|
||||
if (proto_metrics.has_app_package_name()) {
|
||||
group_builder.AddValue("app_package_name",
|
||||
proto_metrics.app_package_name());
|
||||
}
|
||||
group_builder.AddDistributions("cdm_engine_add_key_time_us",
|
||||
proto_metrics.cdm_engine_add_key_time_us());
|
||||
if (proto_metrics.has_cdm_engine_cdm_version()) {
|
||||
group_builder.AddValue("cdm_engine_cdm_version",
|
||||
proto_metrics.cdm_engine_cdm_version());
|
||||
}
|
||||
group_builder.AddCounters("cdm_engine_close_session",
|
||||
proto_metrics.cdm_engine_close_session());
|
||||
if (proto_metrics.has_cdm_engine_creation_time_millis()) {
|
||||
group_builder.AddValue("cdm_engine_creation_time_millis",
|
||||
proto_metrics.cdm_engine_creation_time_millis());
|
||||
}
|
||||
group_builder.AddDistributions("cdm_engine_decrypt_time_us",
|
||||
proto_metrics.cdm_engine_decrypt_time_us());
|
||||
group_builder.AddCounters("cdm_engine_find_session_for_key",
|
||||
proto_metrics.cdm_engine_find_session_for_key());
|
||||
group_builder.AddDistributions(
|
||||
"cdm_engine_generate_key_request_time_us",
|
||||
proto_metrics.cdm_engine_generate_key_request_time_us());
|
||||
group_builder.AddDistributions(
|
||||
"cdm_engine_get_provisioning_request_time_us",
|
||||
proto_metrics.cdm_engine_get_provisioning_request_time_us());
|
||||
group_builder.AddCounters("cdm_engine_get_secure_stop_ids",
|
||||
proto_metrics.cdm_engine_get_secure_stop_ids());
|
||||
group_builder.AddDistributions(
|
||||
"cdm_engine_get_usage_info_time_us",
|
||||
proto_metrics.cdm_engine_get_usage_info_time_us());
|
||||
group_builder.AddDistributions(
|
||||
"cdm_engine_handle_provisioning_response_time_us",
|
||||
proto_metrics.cdm_engine_handle_provisioning_response_time_us());
|
||||
if (proto_metrics.has_cdm_engine_life_span_ms()) {
|
||||
group_builder.AddValue("cdm_engine_life_span_ms",
|
||||
proto_metrics.cdm_engine_life_span_ms());
|
||||
}
|
||||
group_builder.AddCounters("cdm_engine_open_key_set_session",
|
||||
proto_metrics.cdm_engine_open_key_set_session());
|
||||
group_builder.AddCounters("cdm_engine_open_session",
|
||||
proto_metrics.cdm_engine_open_session());
|
||||
group_builder.AddDistributions(
|
||||
"cdm_engine_query_key_status_time_us",
|
||||
proto_metrics.cdm_engine_query_key_status_time_us());
|
||||
group_builder.AddCounters("cdm_engine_release_all_usage_info",
|
||||
proto_metrics.cdm_engine_release_all_usage_info());
|
||||
group_builder.AddCounters("cdm_engine_release_usage_info",
|
||||
proto_metrics.cdm_engine_release_usage_info());
|
||||
group_builder.AddCounters("cdm_engine_remove_all_usage_info",
|
||||
proto_metrics.cdm_engine_remove_all_usage_info());
|
||||
group_builder.AddCounters("cdm_engine_remove_keys",
|
||||
proto_metrics.cdm_engine_remove_keys());
|
||||
group_builder.AddCounters("cdm_engine_remove_usage_info",
|
||||
proto_metrics.cdm_engine_remove_usage_info());
|
||||
group_builder.AddDistributions(
|
||||
"cdm_engine_restore_key_time_us",
|
||||
proto_metrics.cdm_engine_restore_key_time_us());
|
||||
group_builder.AddCounters("cdm_engine_unprovision",
|
||||
proto_metrics.cdm_engine_unprovision());
|
||||
if (proto_metrics.has_level3_oemcrypto_initialization_error()) {
|
||||
group_builder.AddValue(
|
||||
"level3_oemcrypto_initialization_error",
|
||||
proto_metrics.level3_oemcrypto_initialization_error());
|
||||
}
|
||||
if (proto_metrics.has_previous_oemcrypto_initialization_failure()) {
|
||||
group_builder.AddValue(
|
||||
"previous_oemcrypto_initialization_failure",
|
||||
proto_metrics.previous_oemcrypto_initialization_failure());
|
||||
}
|
||||
|
||||
group_vector_.emplace_back(group_builder.Build());
|
||||
}
|
||||
|
||||
void WvMetricsAdapter::AddSessionMetrics(
|
||||
const drm_metrics::WvCdmMetrics::SessionMetrics& proto_metrics) {
|
||||
WvMetricsGroupBuilder group_builder;
|
||||
AddCryptoMetrics(proto_metrics.crypto_metrics(), &group_builder);
|
||||
|
||||
if (proto_metrics.has_session_id()) {
|
||||
group_builder.AddValue("session_id", proto_metrics.session_id());
|
||||
}
|
||||
if (proto_metrics.has_cdm_session_life_span_ms()) {
|
||||
group_builder.AddValue("cdm_session_life_span_ms",
|
||||
proto_metrics.cdm_session_life_span_ms());
|
||||
}
|
||||
group_builder.AddDistributions("cdm_session_renew_key_time_us",
|
||||
proto_metrics.cdm_session_renew_key_time_us());
|
||||
group_builder.AddCounters(
|
||||
"cdm_session_restore_offline_session",
|
||||
proto_metrics.cdm_session_restore_offline_session());
|
||||
group_builder.AddCounters("cdm_session_restore_usage_session",
|
||||
proto_metrics.cdm_session_restore_usage_session());
|
||||
group_builder.AddDistributions(
|
||||
"cdm_session_license_request_latency_ms",
|
||||
proto_metrics.cdm_session_license_request_latency_ms());
|
||||
if (proto_metrics.has_oemcrypto_build_info()) {
|
||||
group_builder.AddValue("oemcrypto_build_info",
|
||||
proto_metrics.oemcrypto_build_info());
|
||||
}
|
||||
if (proto_metrics.has_license_sdk_version()) {
|
||||
group_builder.AddValue("license_sdk_version",
|
||||
proto_metrics.license_sdk_version());
|
||||
}
|
||||
if (proto_metrics.has_license_service_version()) {
|
||||
group_builder.AddValue("license_service_version",
|
||||
proto_metrics.license_service_version());
|
||||
}
|
||||
if (proto_metrics.has_playback_id()) {
|
||||
group_builder.AddValue("playback_id", proto_metrics.playback_id());
|
||||
}
|
||||
group_vector_.emplace_back(group_builder.Build());
|
||||
}
|
||||
|
||||
void WvMetricsAdapter::AddCryptoMetrics(
|
||||
const drm_metrics::WvCdmMetrics::CryptoMetrics& proto_metrics,
|
||||
WvMetricsGroupBuilder* group_builder) {
|
||||
if (proto_metrics.has_crypto_session_security_level()) {
|
||||
group_builder->AddValue("crypto_session_security_level",
|
||||
proto_metrics.crypto_session_security_level());
|
||||
}
|
||||
group_builder->AddCounters(
|
||||
"crypto_session_delete_all_usage_reports",
|
||||
proto_metrics.crypto_session_delete_all_usage_reports());
|
||||
group_builder->AddCounters(
|
||||
"crypto_session_delete_multiple_usage_information",
|
||||
proto_metrics.crypto_session_delete_multiple_usage_information());
|
||||
group_builder->AddDistributions(
|
||||
"crypto_session_generic_decrypt_time_us",
|
||||
proto_metrics.crypto_session_generic_decrypt_time_us());
|
||||
group_builder->AddDistributions(
|
||||
"crypto_session_generic_encrypt_time_us",
|
||||
proto_metrics.crypto_session_generic_encrypt_time_us());
|
||||
group_builder->AddDistributions(
|
||||
"crypto_session_generic_sign_time_us",
|
||||
proto_metrics.crypto_session_generic_sign_time_us());
|
||||
group_builder->AddDistributions(
|
||||
"crypto_session_generic_verify_time_us",
|
||||
proto_metrics.crypto_session_generic_verify_time_us());
|
||||
group_builder->AddCounters(
|
||||
"crypto_session_get_device_unique_id",
|
||||
proto_metrics.crypto_session_get_device_unique_id());
|
||||
group_builder->AddCounters("crypto_session_get_token",
|
||||
proto_metrics.crypto_session_get_token());
|
||||
if (proto_metrics.has_crypto_session_life_span()) {
|
||||
group_builder->AddValue("crypto_session_life_span",
|
||||
proto_metrics.crypto_session_life_span());
|
||||
}
|
||||
group_builder->AddDistributions(
|
||||
"crypto_session_load_certificate_private_key_time_us",
|
||||
proto_metrics.crypto_session_load_certificate_private_key_time_us());
|
||||
group_builder->AddDistributions("crypto_session_open_time_us",
|
||||
proto_metrics.crypto_session_open_time_us());
|
||||
if (proto_metrics.has_crypto_session_system_id()) {
|
||||
group_builder->AddValue("crypto_session_system_id",
|
||||
proto_metrics.crypto_session_system_id());
|
||||
}
|
||||
group_builder->AddDistributions(
|
||||
"crypto_session_update_usage_information_time_us",
|
||||
proto_metrics.crypto_session_update_usage_information_time_us());
|
||||
if (proto_metrics.has_crypto_session_usage_information_support()) {
|
||||
group_builder->AddValue(
|
||||
"crypto_session_usage_information_support",
|
||||
proto_metrics.crypto_session_usage_information_support());
|
||||
}
|
||||
if (proto_metrics.has_usage_table_header_initial_size()) {
|
||||
group_builder->AddValue("usage_table_header_initial_size",
|
||||
proto_metrics.usage_table_header_initial_size());
|
||||
}
|
||||
group_builder->AddCounters("usage_table_header_add_entry",
|
||||
proto_metrics.usage_table_header_add_entry());
|
||||
group_builder->AddCounters("usage_table_header_delete_entry",
|
||||
proto_metrics.usage_table_header_delete_entry());
|
||||
group_builder->AddDistributions(
|
||||
"usage_table_header_update_entry_time_us",
|
||||
proto_metrics.usage_table_header_update_entry_time_us());
|
||||
group_builder->AddCounters("usage_table_header_load_entry",
|
||||
proto_metrics.usage_table_header_load_entry());
|
||||
if (proto_metrics.has_oemcrypto_api_version()) {
|
||||
group_builder->AddValue("oemcrypto_api_version",
|
||||
proto_metrics.oemcrypto_api_version());
|
||||
}
|
||||
group_builder->AddCounters("oemcrypto_close_session",
|
||||
proto_metrics.oemcrypto_close_session());
|
||||
group_builder->AddDistributions(
|
||||
"oemcrypto_copy_buffer_time_us",
|
||||
proto_metrics.oemcrypto_copy_buffer_time_us());
|
||||
if (proto_metrics.has_oemcrypto_current_hdcp_capability()) {
|
||||
group_builder->AddValue("oemcrypto_current_hdcp_capability",
|
||||
proto_metrics.oemcrypto_current_hdcp_capability());
|
||||
}
|
||||
group_builder->AddCounters("oemcrypto_deactivate_usage_entry",
|
||||
proto_metrics.oemcrypto_deactivate_usage_entry());
|
||||
group_builder->AddDistributions(
|
||||
"oemcrypto_decrypt_cenc_time_us",
|
||||
proto_metrics.oemcrypto_decrypt_cenc_time_us());
|
||||
group_builder->AddCounters("oemcrypto_delete_usage_entry",
|
||||
proto_metrics.oemcrypto_delete_usage_entry());
|
||||
group_builder->AddCounters("oemcrypto_delete_usage_table",
|
||||
proto_metrics.oemcrypto_delete_usage_table());
|
||||
group_builder->AddDistributions(
|
||||
"oemcrypto_derive_keys_from_session_key_time_us",
|
||||
proto_metrics.oemcrypto_derive_keys_from_session_key_time_us());
|
||||
group_builder->AddCounters(
|
||||
"oemcrypto_force_delete_usage_entry",
|
||||
proto_metrics.oemcrypto_force_delete_usage_entry());
|
||||
group_builder->AddDistributions(
|
||||
"oemcrypto_generate_derived_keys_time_us",
|
||||
proto_metrics.oemcrypto_generate_derived_keys_time_us());
|
||||
group_builder->AddCounters("oemcrypto_generate_nonce",
|
||||
proto_metrics.oemcrypto_generate_nonce());
|
||||
group_builder->AddDistributions(
|
||||
"oemcrypto_generate_rsa_signature_time_us",
|
||||
proto_metrics.oemcrypto_generate_rsa_signature_time_us());
|
||||
group_builder->AddDistributions(
|
||||
"oemcrypto_generate_signature_time_us",
|
||||
proto_metrics.oemcrypto_generate_signature_time_us());
|
||||
group_builder->AddDistributions(
|
||||
"oemcrypto_generic_decrypt_time_us",
|
||||
proto_metrics.oemcrypto_generic_decrypt_time_us());
|
||||
group_builder->AddDistributions(
|
||||
"oemcrypto_generic_encrypt_time_us",
|
||||
proto_metrics.oemcrypto_generic_encrypt_time_us());
|
||||
group_builder->AddDistributions(
|
||||
"oemcrypto_generic_sign_time_us",
|
||||
proto_metrics.oemcrypto_generic_sign_time_us());
|
||||
group_builder->AddDistributions(
|
||||
"oemcrypto_generic_verify_time_us",
|
||||
proto_metrics.oemcrypto_generic_verify_time_us());
|
||||
group_builder->AddCounters("oemcrypto_get_device_id",
|
||||
proto_metrics.oemcrypto_get_device_id());
|
||||
group_builder->AddDistributions(
|
||||
"oemcrypto_get_key_data_time_us",
|
||||
proto_metrics.oemcrypto_get_key_data_time_us());
|
||||
group_builder->AddCounters(
|
||||
"oemcrypto_get_oem_public_certificate",
|
||||
proto_metrics.oemcrypto_get_oem_public_certificate());
|
||||
group_builder->AddCounters("oemcrypto_get_random",
|
||||
proto_metrics.oemcrypto_get_random());
|
||||
group_builder->AddDistributions("oemcrypto_initialize_time_us",
|
||||
proto_metrics.oemcrypto_initialize_time_us());
|
||||
if (proto_metrics.has_oemcrypto_is_anti_rollback_hw_present()) {
|
||||
group_builder->AddValue(
|
||||
"oemcrypto_is_anti_rollback_hw_present",
|
||||
proto_metrics.oemcrypto_is_anti_rollback_hw_present());
|
||||
}
|
||||
if (proto_metrics.has_oemcrypto_is_keybox_valid()) {
|
||||
group_builder->AddValue("oemcrypto_is_keybox_valid",
|
||||
proto_metrics.oemcrypto_is_keybox_valid());
|
||||
}
|
||||
group_builder->AddDistributions(
|
||||
"oemcrypto_load_device_drm_key_time_us",
|
||||
proto_metrics.oemcrypto_load_device_drm_key_time_us());
|
||||
group_builder->AddDistributions(
|
||||
"oemcrypto_load_entitled_keys_time_us",
|
||||
proto_metrics.oemcrypto_load_entitled_keys_time_us());
|
||||
group_builder->AddDistributions("oemcrypto_load_keys_time_us",
|
||||
proto_metrics.oemcrypto_load_keys_time_us());
|
||||
if (proto_metrics.has_oemcrypto_max_hdcp_capability()) {
|
||||
group_builder->AddValue("oemcrypto_max_hdcp_capability",
|
||||
proto_metrics.oemcrypto_max_hdcp_capability());
|
||||
}
|
||||
if (proto_metrics.has_oemcrypto_max_number_of_sessions()) {
|
||||
group_builder->AddValue("oemcrypto_max_number_of_sessions",
|
||||
proto_metrics.oemcrypto_max_number_of_sessions());
|
||||
}
|
||||
if (proto_metrics.has_oemcrypto_number_of_open_sessions()) {
|
||||
group_builder->AddValue("oemcrypto_number_of_open_sessions",
|
||||
proto_metrics.oemcrypto_number_of_open_sessions());
|
||||
}
|
||||
if (proto_metrics.has_oemcrypto_provisioning_method()) {
|
||||
group_builder->AddValue("oemcrypto_provisioning_method",
|
||||
proto_metrics.oemcrypto_provisioning_method());
|
||||
}
|
||||
group_builder->AddDistributions(
|
||||
"oemcrypto_refresh_keys_time_us",
|
||||
proto_metrics.oemcrypto_refresh_keys_time_us());
|
||||
group_builder->AddCounters("oemcrypto_report_usage",
|
||||
proto_metrics.oemcrypto_report_usage());
|
||||
group_builder->AddDistributions(
|
||||
"oemcrypto_rewrap_device_rsa_key_time_us",
|
||||
proto_metrics.oemcrypto_rewrap_device_rsa_key_time_us());
|
||||
group_builder->AddDistributions(
|
||||
"oemcrypto_rewrap_device_rsa_key_30_time_us",
|
||||
proto_metrics.oemcrypto_rewrap_device_rsa_key_30_time_us());
|
||||
if (proto_metrics.has_oemcrypto_security_patch_level()) {
|
||||
group_builder->AddValue("oemcrypto_security_patch_level",
|
||||
proto_metrics.oemcrypto_security_patch_level());
|
||||
}
|
||||
group_builder->AddDistributions("oemcrypto_select_key_time_us",
|
||||
proto_metrics.oemcrypto_select_key_time_us());
|
||||
if (proto_metrics.has_oemcrypto_usage_table_support()) {
|
||||
group_builder->AddValue("oemcrypto_usage_table_support",
|
||||
proto_metrics.oemcrypto_usage_table_support());
|
||||
}
|
||||
group_builder->AddCounters("oemcrypto_update_usage_table",
|
||||
proto_metrics.oemcrypto_update_usage_table());
|
||||
group_builder->AddCounters("oemcrypto_update_usage_entry",
|
||||
proto_metrics.oemcrypto_update_usage_entry());
|
||||
}
|
||||
|
||||
const std::vector<DrmMetricGroup> WvMetricsAdapter::GetWvGroupVector() {
|
||||
return group_vector_;
|
||||
}
|
||||
|
||||
void WvMetricsAdapter::ToWvMetrics(
|
||||
const drm_metrics::WvCdmMetrics& proto_metrics,
|
||||
std::vector<DrmMetricGroup>* wv_metrics) {
|
||||
// Convert the engine level metrics
|
||||
wvcdm::WvMetricsAdapter adapter;
|
||||
|
||||
if (proto_metrics.has_engine_metrics()) {
|
||||
adapter.AddEngineMetrics(proto_metrics.engine_metrics());
|
||||
}
|
||||
for (const auto& session_metrics : proto_metrics.session_metrics()) {
|
||||
adapter.AddSessionMetrics(session_metrics);
|
||||
}
|
||||
|
||||
*wv_metrics = adapter.GetWvGroupVector();
|
||||
}
|
||||
|
||||
} // namespace wvcdm
|
||||
@@ -7,19 +7,20 @@
|
||||
#ifndef WV_DRM_PLUGIN_H_
|
||||
#define WV_DRM_PLUGIN_H_
|
||||
|
||||
#include <map>
|
||||
#include <list>
|
||||
#include <utils/Mutex.h>
|
||||
|
||||
#include <list>
|
||||
#include <map>
|
||||
|
||||
#include "HidlTypes.h"
|
||||
#include "OEMCryptoCENC.h"
|
||||
#include "WVGenericCryptoInterface.h"
|
||||
#include "WVTypes.h"
|
||||
#include "cdm_client_property_set.h"
|
||||
#include "cdm_identifier.h"
|
||||
#include "log.h"
|
||||
#include "wv_cdm_event_listener.h"
|
||||
#include "wv_content_decryption_module.h"
|
||||
#include "OEMCryptoCENC.h"
|
||||
#include "HidlTypes.h"
|
||||
#include "WVGenericCryptoInterface.h"
|
||||
#include "WVTypes.h"
|
||||
#include <utils/Mutex.h>
|
||||
|
||||
namespace wvdrm {
|
||||
namespace hardware {
|
||||
@@ -27,24 +28,23 @@ namespace drm {
|
||||
namespace V1_4 {
|
||||
namespace widevine {
|
||||
|
||||
using std::map;
|
||||
using android::Mutex;
|
||||
using std::map;
|
||||
using wvcdm::CdmIdentifier;
|
||||
using wvcdm::CdmKeyStatusMap;
|
||||
using wvcdm::CdmSessionId;
|
||||
using wvcdm::CdmResponseType;
|
||||
using wvcdm::CdmSessionId;
|
||||
using wvcdm::WvContentDecryptionModule;
|
||||
|
||||
const OEMCrypto_Algorithm kInvalidCryptoAlgorithm =
|
||||
static_cast<OEMCrypto_Algorithm>(-1);
|
||||
|
||||
struct WVDrmPlugin : public ::drm::V1_4::IDrmPlugin, IDrmPluginListener,
|
||||
wvcdm::WvCdmEventListener {
|
||||
|
||||
struct WVDrmPlugin : public ::drm::V1_4::IDrmPlugin,
|
||||
IDrmPluginListener,
|
||||
wvcdm::WvCdmEventListener {
|
||||
WVDrmPlugin(const sp<WvContentDecryptionModule>& cdm,
|
||||
const std::string& appPackageName,
|
||||
WVGenericCryptoInterface* crypto,
|
||||
bool useSpoid);
|
||||
WVGenericCryptoInterface* crypto, bool useSpoid);
|
||||
|
||||
virtual ~WVDrmPlugin();
|
||||
|
||||
@@ -52,53 +52,44 @@ struct WVDrmPlugin : public ::drm::V1_4::IDrmPlugin, IDrmPluginListener,
|
||||
|
||||
Return<void> openSession(openSession_cb _hidl_cb) override;
|
||||
|
||||
Return<void> openSession_1_1(SecurityLevel securityLevel, openSession_1_1_cb _hidl_cb) override;
|
||||
Return<void> openSession_1_1(SecurityLevel securityLevel,
|
||||
openSession_1_1_cb _hidl_cb) override;
|
||||
|
||||
Return<Status> closeSession(const hidl_vec<uint8_t>& sessionId) override;
|
||||
|
||||
Return<void> getKeyRequest(
|
||||
const hidl_vec<uint8_t>& scope,
|
||||
const hidl_vec<uint8_t>& initData,
|
||||
const hidl_string& mimeType,
|
||||
KeyType keyType,
|
||||
const hidl_vec<KeyValue>& optionalParameters,
|
||||
getKeyRequest_cb _hidl_cb) override;
|
||||
Return<void> getKeyRequest(const hidl_vec<uint8_t>& scope,
|
||||
const hidl_vec<uint8_t>& initData,
|
||||
const hidl_string& mimeType, KeyType keyType,
|
||||
const hidl_vec<KeyValue>& optionalParameters,
|
||||
getKeyRequest_cb _hidl_cb) override;
|
||||
|
||||
Return<void> getKeyRequest_1_1(
|
||||
const hidl_vec<uint8_t>& scope,
|
||||
const hidl_vec<uint8_t>& initData,
|
||||
const hidl_string& mimeType,
|
||||
KeyType keyType,
|
||||
const hidl_vec<KeyValue>& optionalParameters,
|
||||
getKeyRequest_1_1_cb _hidl_cb) override;
|
||||
Return<void> getKeyRequest_1_1(const hidl_vec<uint8_t>& scope,
|
||||
const hidl_vec<uint8_t>& initData,
|
||||
const hidl_string& mimeType, KeyType keyType,
|
||||
const hidl_vec<KeyValue>& optionalParameters,
|
||||
getKeyRequest_1_1_cb _hidl_cb) override;
|
||||
|
||||
Return<void> getKeyRequest_1_2(
|
||||
const hidl_vec<uint8_t>& scope,
|
||||
const hidl_vec<uint8_t>& initData,
|
||||
const hidl_string& mimeType,
|
||||
KeyType keyType,
|
||||
const hidl_vec<KeyValue>& optionalParameters,
|
||||
getKeyRequest_1_2_cb _hidl_cb) override;
|
||||
Return<void> getKeyRequest_1_2(const hidl_vec<uint8_t>& scope,
|
||||
const hidl_vec<uint8_t>& initData,
|
||||
const hidl_string& mimeType, KeyType keyType,
|
||||
const hidl_vec<KeyValue>& optionalParameters,
|
||||
getKeyRequest_1_2_cb _hidl_cb) override;
|
||||
|
||||
Return<void> provideKeyResponse(
|
||||
const hidl_vec<uint8_t>& scope,
|
||||
const hidl_vec<uint8_t>& response,
|
||||
provideKeyResponse_cb _hidl_cb) override;
|
||||
Return<void> provideKeyResponse(const hidl_vec<uint8_t>& scope,
|
||||
const hidl_vec<uint8_t>& response,
|
||||
provideKeyResponse_cb _hidl_cb) override;
|
||||
|
||||
Return<Status> removeKeys(const hidl_vec<uint8_t>& sessionId) override;
|
||||
|
||||
Return<Status> restoreKeys(
|
||||
const hidl_vec<uint8_t>& sessionId,
|
||||
const hidl_vec<uint8_t>& keySetId) override;
|
||||
Return<Status> restoreKeys(const hidl_vec<uint8_t>& sessionId,
|
||||
const hidl_vec<uint8_t>& keySetId) override;
|
||||
|
||||
Return<void> queryKeyStatus(
|
||||
const hidl_vec<uint8_t>& sessionId,
|
||||
queryKeyStatus_cb _hidl_cb) override;
|
||||
Return<void> queryKeyStatus(const hidl_vec<uint8_t>& sessionId,
|
||||
queryKeyStatus_cb _hidl_cb) override;
|
||||
|
||||
Return<void> getProvisionRequest(
|
||||
const hidl_string& certificateType,
|
||||
const hidl_string& certificateAuthority,
|
||||
getProvisionRequest_cb _hidl_cb) override;
|
||||
Return<void> getProvisionRequest(const hidl_string& certificateType,
|
||||
const hidl_string& certificateAuthority,
|
||||
getProvisionRequest_cb _hidl_cb) override;
|
||||
|
||||
Return<void> getProvisionRequest_1_2(
|
||||
const hidl_string& certificateType,
|
||||
@@ -111,9 +102,8 @@ struct WVDrmPlugin : public ::drm::V1_4::IDrmPlugin, IDrmPluginListener,
|
||||
|
||||
Return<void> getSecureStops(getSecureStops_cb _hidl_cb) override;
|
||||
|
||||
Return<void> getSecureStop(
|
||||
const hidl_vec<uint8_t>& secureStopId,
|
||||
getSecureStop_cb _hidl_cb) override;
|
||||
Return<void> getSecureStop(const hidl_vec<uint8_t>& secureStopId,
|
||||
getSecureStop_cb _hidl_cb) override;
|
||||
|
||||
Return<Status> releaseAllSecureStops() override;
|
||||
|
||||
@@ -124,9 +114,11 @@ struct WVDrmPlugin : public ::drm::V1_4::IDrmPlugin, IDrmPluginListener,
|
||||
|
||||
Return<void> getSecureStopIds(getSecureStopIds_cb _hidl_cb) override;
|
||||
|
||||
Return<Status> releaseSecureStops(const SecureStopRelease& ssRelease) override;
|
||||
Return<Status> releaseSecureStops(
|
||||
const SecureStopRelease& ssRelease) override;
|
||||
|
||||
Return<Status> removeSecureStop(const hidl_vec<uint8_t>& secureStopId) override;
|
||||
Return<Status> removeSecureStop(
|
||||
const hidl_vec<uint8_t>& secureStopId) override;
|
||||
|
||||
Return<Status> removeAllSecureStops() override;
|
||||
|
||||
@@ -136,101 +128,87 @@ struct WVDrmPlugin : public ::drm::V1_4::IDrmPlugin, IDrmPluginListener,
|
||||
Return<void> getNumberOfSessions(getNumberOfSessions_cb _hidl_cb) override;
|
||||
|
||||
Return<void> getSecurityLevel(const hidl_vec<uint8_t>& sessionId,
|
||||
getSecurityLevel_cb _hidl_cb) override;
|
||||
getSecurityLevel_cb _hidl_cb) override;
|
||||
|
||||
Return<void> getOfflineLicenseKeySetIds(
|
||||
getOfflineLicenseKeySetIds_cb _hidl_cb) override;
|
||||
|
||||
Return<Status> removeOfflineLicense(const KeySetId &keySetId) override;
|
||||
Return<Status> removeOfflineLicense(const KeySetId& keySetId) override;
|
||||
|
||||
Return<void> getOfflineLicenseState(const KeySetId &keySetId,
|
||||
getOfflineLicenseState_cb _hidl_cb) override;
|
||||
Return<void> getOfflineLicenseState(
|
||||
const KeySetId& keySetId, getOfflineLicenseState_cb _hidl_cb) override;
|
||||
|
||||
Return<void> getPropertyString(
|
||||
const hidl_string& propertyName,
|
||||
getPropertyString_cb _hidl_cb) override;
|
||||
Return<void> getPropertyString(const hidl_string& propertyName,
|
||||
getPropertyString_cb _hidl_cb) override;
|
||||
|
||||
Return<void> getPropertyByteArray(
|
||||
const hidl_string& propertyName,
|
||||
getPropertyByteArray_cb _hidl_cb) override;
|
||||
Return<void> getPropertyByteArray(const hidl_string& propertyName,
|
||||
getPropertyByteArray_cb _hidl_cb) override;
|
||||
|
||||
Return<Status> setPropertyString(
|
||||
const hidl_string& propertyName,
|
||||
const hidl_string& value) override;
|
||||
Return<Status> setPropertyString(const hidl_string& propertyName,
|
||||
const hidl_string& value) override;
|
||||
|
||||
Return<Status> setPropertyByteArray(
|
||||
const hidl_string& propertyName,
|
||||
const hidl_vec<uint8_t>& value) override;
|
||||
Return<Status> setPropertyByteArray(const hidl_string& propertyName,
|
||||
const hidl_vec<uint8_t>& value) override;
|
||||
|
||||
Return<Status> setCipherAlgorithm(
|
||||
const hidl_vec<uint8_t>& sessionId,
|
||||
const hidl_string& algorithm) override;
|
||||
Return<Status> setCipherAlgorithm(const hidl_vec<uint8_t>& sessionId,
|
||||
const hidl_string& algorithm) override;
|
||||
|
||||
Return<Status> setMacAlgorithm(
|
||||
const hidl_vec<uint8_t>& sessionId,
|
||||
const hidl_string& algorithm) override;
|
||||
Return<Status> setMacAlgorithm(const hidl_vec<uint8_t>& sessionId,
|
||||
const hidl_string& algorithm) override;
|
||||
|
||||
Return<void> encrypt(
|
||||
const hidl_vec<uint8_t>& sessionId,
|
||||
const hidl_vec<uint8_t>& keyId,
|
||||
const hidl_vec<uint8_t>& input,
|
||||
const hidl_vec<uint8_t>& iv,
|
||||
encrypt_cb _hidl_cb) override;
|
||||
Return<void> encrypt(const hidl_vec<uint8_t>& sessionId,
|
||||
const hidl_vec<uint8_t>& keyId,
|
||||
const hidl_vec<uint8_t>& input,
|
||||
const hidl_vec<uint8_t>& iv,
|
||||
encrypt_cb _hidl_cb) override;
|
||||
|
||||
Return<void> decrypt(
|
||||
const hidl_vec<uint8_t>& sessionId,
|
||||
const hidl_vec<uint8_t>& keyId,
|
||||
const hidl_vec<uint8_t>& input,
|
||||
const hidl_vec<uint8_t>& iv,
|
||||
decrypt_cb _hidl_cb) override;
|
||||
Return<void> decrypt(const hidl_vec<uint8_t>& sessionId,
|
||||
const hidl_vec<uint8_t>& keyId,
|
||||
const hidl_vec<uint8_t>& input,
|
||||
const hidl_vec<uint8_t>& iv,
|
||||
decrypt_cb _hidl_cb) override;
|
||||
|
||||
Return<void> sign(const hidl_vec<uint8_t>& sessionId,
|
||||
const hidl_vec<uint8_t>& keyId, const hidl_vec<uint8_t>& message,
|
||||
sign_cb _hidl_cb) override;
|
||||
const hidl_vec<uint8_t>& keyId,
|
||||
const hidl_vec<uint8_t>& message,
|
||||
sign_cb _hidl_cb) override;
|
||||
|
||||
Return<void> verify(
|
||||
const hidl_vec<uint8_t>& sessionId,
|
||||
const hidl_vec<uint8_t>& keyId,
|
||||
const hidl_vec<uint8_t>& message,
|
||||
const hidl_vec<uint8_t>& signature,
|
||||
verify_cb _hidl_cb) override;
|
||||
Return<void> verify(const hidl_vec<uint8_t>& sessionId,
|
||||
const hidl_vec<uint8_t>& keyId,
|
||||
const hidl_vec<uint8_t>& message,
|
||||
const hidl_vec<uint8_t>& signature,
|
||||
verify_cb _hidl_cb) override;
|
||||
|
||||
Return<void> signRSA(
|
||||
const hidl_vec<uint8_t>& sessionId,
|
||||
const hidl_string& algorithm,
|
||||
const hidl_vec<uint8_t>& message,
|
||||
const hidl_vec<uint8_t>& wrappedkey,
|
||||
signRSA_cb _hidl_cb) override;
|
||||
Return<void> signRSA(const hidl_vec<uint8_t>& sessionId,
|
||||
const hidl_string& algorithm,
|
||||
const hidl_vec<uint8_t>& message,
|
||||
const hidl_vec<uint8_t>& wrappedkey,
|
||||
signRSA_cb _hidl_cb) override;
|
||||
|
||||
Return<void> setListener(const sp<IDrmPluginListener>& listener) override;
|
||||
|
||||
Return<void> sendEvent(
|
||||
EventType eventType,
|
||||
const hidl_vec<uint8_t>& sessionId,
|
||||
const hidl_vec<uint8_t>& data) override;
|
||||
Return<void> sendEvent(EventType eventType,
|
||||
const hidl_vec<uint8_t>& sessionId,
|
||||
const hidl_vec<uint8_t>& data) override;
|
||||
|
||||
Return<void> sendExpirationUpdate(
|
||||
const hidl_vec<uint8_t>& sessionId,
|
||||
int64_t expiryTimeInMS) override;
|
||||
Return<void> sendExpirationUpdate(const hidl_vec<uint8_t>& sessionId,
|
||||
int64_t expiryTimeInMS) override;
|
||||
|
||||
Return<void> sendKeysChange(
|
||||
const hidl_vec<uint8_t>& sessionId,
|
||||
const hidl_vec<KeyStatus>& keyStatusList,
|
||||
bool hasNewUsableKey) override;
|
||||
Return<void> sendKeysChange(const hidl_vec<uint8_t>& sessionId,
|
||||
const hidl_vec<KeyStatus>& keyStatusList,
|
||||
bool hasNewUsableKey) override;
|
||||
|
||||
Return<void> sendKeysChange_1_2(
|
||||
const hidl_vec<uint8_t>& sessionId,
|
||||
const hidl_vec<KeyStatus_V1_2>& keyStatusList,
|
||||
bool hasNewUsableKey) override;
|
||||
Return<void> sendKeysChange_1_2(const hidl_vec<uint8_t>& sessionId,
|
||||
const hidl_vec<KeyStatus_V1_2>& keyStatusList,
|
||||
bool hasNewUsableKey) override;
|
||||
|
||||
Return<void> sendSessionLostState(
|
||||
const hidl_vec<uint8_t>& sessionId) override;
|
||||
|
||||
Return<void> getLogMessages(
|
||||
getLogMessages_cb _hidl_cb) override;
|
||||
Return<void> getLogMessages(getLogMessages_cb _hidl_cb) override;
|
||||
|
||||
Return<bool> requiresSecureDecoder(const hidl_string& mime, SecurityLevel level)
|
||||
override;
|
||||
Return<bool> requiresSecureDecoder(const hidl_string& mime,
|
||||
SecurityLevel level) override;
|
||||
|
||||
Return<bool> requiresSecureDecoderDefault(const hidl_string& mime) override;
|
||||
|
||||
@@ -243,29 +221,22 @@ struct WVDrmPlugin : public ::drm::V1_4::IDrmPlugin, IDrmPluginListener,
|
||||
|
||||
virtual void OnSessionRenewalNeeded(const CdmSessionId& cdmSessionId);
|
||||
|
||||
template<typename KS>
|
||||
void _sendKeysChange(
|
||||
const hidl_vec<uint8_t>& sessionId,
|
||||
const hidl_vec<KS>& keyStatusList,
|
||||
bool hasNewUsableKey);
|
||||
template <typename KS>
|
||||
void _sendKeysChange(const hidl_vec<uint8_t>& sessionId,
|
||||
const hidl_vec<KS>& keyStatusList, bool hasNewUsableKey);
|
||||
|
||||
template<typename KS>
|
||||
void _OnSessionKeysChange(
|
||||
const CdmSessionId&,
|
||||
const CdmKeyStatusMap&,
|
||||
bool hasNewUsableKey);
|
||||
template <typename KS>
|
||||
void _OnSessionKeysChange(const CdmSessionId&, const CdmKeyStatusMap&,
|
||||
bool hasNewUsableKey);
|
||||
|
||||
virtual void OnSessionKeysChange(
|
||||
const CdmSessionId& cdmSessionId,
|
||||
const CdmKeyStatusMap& cdmKeysStatus,
|
||||
bool hasNewUsableKey);
|
||||
virtual void OnSessionKeysChange(const CdmSessionId& cdmSessionId,
|
||||
const CdmKeyStatusMap& cdmKeysStatus,
|
||||
bool hasNewUsableKey);
|
||||
|
||||
virtual void OnExpirationUpdate(
|
||||
const CdmSessionId& cdmSessionId,
|
||||
int64_t newExpiryTimeSeconds);
|
||||
virtual void OnExpirationUpdate(const CdmSessionId& cdmSessionId,
|
||||
int64_t newExpiryTimeSeconds);
|
||||
|
||||
virtual void OnSessionLostState(
|
||||
const CdmSessionId& cdmSessionId);
|
||||
virtual void OnSessionLostState(const CdmSessionId& cdmSessionId);
|
||||
|
||||
private:
|
||||
WVDRM_DISALLOW_COPY_AND_ASSIGN_AND_NEW(WVDrmPlugin);
|
||||
@@ -277,14 +248,14 @@ struct WVDrmPlugin : public ::drm::V1_4::IDrmPlugin, IDrmPluginListener,
|
||||
struct CryptoSession {
|
||||
public:
|
||||
CryptoSession()
|
||||
: mOecSessionId(-1),
|
||||
mCipherAlgorithm(kInvalidCryptoAlgorithm),
|
||||
mMacAlgorithm(kInvalidCryptoAlgorithm) {}
|
||||
: mOecSessionId(-1),
|
||||
mCipherAlgorithm(kInvalidCryptoAlgorithm),
|
||||
mMacAlgorithm(kInvalidCryptoAlgorithm) {}
|
||||
|
||||
CryptoSession(OEMCrypto_SESSION sessionId)
|
||||
: mOecSessionId(sessionId),
|
||||
mCipherAlgorithm(kInvalidCryptoAlgorithm),
|
||||
mMacAlgorithm(kInvalidCryptoAlgorithm) {}
|
||||
: mOecSessionId(sessionId),
|
||||
mCipherAlgorithm(kInvalidCryptoAlgorithm),
|
||||
mMacAlgorithm(kInvalidCryptoAlgorithm) {}
|
||||
|
||||
OEMCrypto_SESSION oecSessionId() const { return mOecSessionId; }
|
||||
|
||||
@@ -309,22 +280,20 @@ struct WVDrmPlugin : public ::drm::V1_4::IDrmPlugin, IDrmPluginListener,
|
||||
class WVClientPropertySet : public wvcdm::CdmClientPropertySet {
|
||||
public:
|
||||
WVClientPropertySet()
|
||||
: mUsePrivacyMode(false), mShareKeys(false), mSessionSharingId(0),
|
||||
mUseAtscMode(false) {}
|
||||
: mUsePrivacyMode(false),
|
||||
mShareKeys(false),
|
||||
mSessionSharingId(0),
|
||||
mUseAtscMode(false) {}
|
||||
|
||||
virtual ~WVClientPropertySet() {}
|
||||
|
||||
virtual const std::string& security_level() const {
|
||||
return mSecurityLevel;
|
||||
}
|
||||
virtual const std::string& security_level() const { return mSecurityLevel; }
|
||||
|
||||
void set_security_level(const std::string& securityLevel) {
|
||||
mSecurityLevel = securityLevel;
|
||||
}
|
||||
|
||||
virtual bool use_privacy_mode() const {
|
||||
return mUsePrivacyMode;
|
||||
}
|
||||
virtual bool use_privacy_mode() const { return mUsePrivacyMode; }
|
||||
|
||||
void set_use_privacy_mode(bool usePrivacyMode) {
|
||||
mUsePrivacyMode = usePrivacyMode;
|
||||
@@ -345,42 +314,28 @@ struct WVDrmPlugin : public ::drm::V1_4::IDrmPlugin, IDrmPluginListener,
|
||||
}
|
||||
|
||||
virtual void set_device_provisioning_service_certificate(
|
||||
const std::string& ) {
|
||||
const std::string&) {
|
||||
// Ignore. Android does not support service certificates for provisioning
|
||||
// TODO(b/69562876): Android SHOULD support service cert for provisioning
|
||||
}
|
||||
|
||||
virtual bool is_session_sharing_enabled() const {
|
||||
return mShareKeys;
|
||||
}
|
||||
virtual bool is_session_sharing_enabled() const { return mShareKeys; }
|
||||
|
||||
void set_is_session_sharing_enabled(bool shareKeys) {
|
||||
mShareKeys = shareKeys;
|
||||
}
|
||||
|
||||
virtual uint32_t session_sharing_id() const {
|
||||
return mSessionSharingId;
|
||||
}
|
||||
virtual uint32_t session_sharing_id() const { return mSessionSharingId; }
|
||||
|
||||
virtual void set_session_sharing_id(uint32_t id) {
|
||||
mSessionSharingId = id;
|
||||
}
|
||||
virtual void set_session_sharing_id(uint32_t id) { mSessionSharingId = id; }
|
||||
|
||||
virtual const std::string& app_id() const {
|
||||
return mAppId;
|
||||
}
|
||||
virtual const std::string& app_id() const { return mAppId; }
|
||||
|
||||
void set_app_id(const std::string& appId) {
|
||||
mAppId = appId;
|
||||
}
|
||||
void set_app_id(const std::string& appId) { mAppId = appId; }
|
||||
|
||||
virtual bool use_atsc_mode() const {
|
||||
return mUseAtscMode;
|
||||
}
|
||||
virtual bool use_atsc_mode() const { return mUseAtscMode; }
|
||||
|
||||
void set_use_atsc_mode(bool useAtscMode) {
|
||||
mUseAtscMode = useAtscMode;
|
||||
}
|
||||
void set_use_atsc_mode(bool useAtscMode) { mUseAtscMode = useAtscMode; }
|
||||
|
||||
private:
|
||||
DISALLOW_EVIL_CONSTRUCTORS(WVClientPropertySet);
|
||||
@@ -444,7 +399,7 @@ struct WVDrmPlugin : public ::drm::V1_4::IDrmPlugin, IDrmPluginListener,
|
||||
// outside this class should use getDeviceUniqueId() to get the
|
||||
// application-safe device-unique ID.
|
||||
Status getOemcryptoDeviceId(std::string* id);
|
||||
Status getOemcryptoDeviceId(wvcdm::SecurityLevel securityLevel,
|
||||
Status getOemcryptoDeviceId(wvcdm::RequestedSecurityLevel securityLevel,
|
||||
std::string* id);
|
||||
|
||||
// The unique identifier is meant to ensure that two clients with the
|
||||
@@ -465,9 +420,7 @@ struct WVDrmPlugin : public ::drm::V1_4::IDrmPlugin, IDrmPluginListener,
|
||||
private:
|
||||
WVDRM_DISALLOW_COPY_AND_ASSIGN(Terminator);
|
||||
|
||||
Terminator() {
|
||||
signal(SIGTERM, Terminate);
|
||||
}
|
||||
Terminator() { signal(SIGTERM, Terminate); }
|
||||
|
||||
static Terminator& instance() {
|
||||
static Terminator instance;
|
||||
@@ -510,37 +463,36 @@ struct WVDrmPlugin : public ::drm::V1_4::IDrmPlugin, IDrmPluginListener,
|
||||
std::string mAppPackageName;
|
||||
|
||||
Status queryProperty(const std::string& property,
|
||||
std::string& stringValue) const;
|
||||
std::string& stringValue) const;
|
||||
|
||||
Status queryProperty(wvcdm::SecurityLevel securityLevel,
|
||||
const std::string& property,
|
||||
std::string& stringValue) const;
|
||||
Status queryProperty(wvcdm::RequestedSecurityLevel securityLevel,
|
||||
const std::string& property,
|
||||
std::string& stringValue) const;
|
||||
|
||||
Status queryProperty(const std::string& property,
|
||||
std::vector<uint8_t>& vector_value) const;
|
||||
std::vector<uint8_t>& vector_value) const;
|
||||
|
||||
bool isProvisioned(wvcdm::CdmSecurityLevel securityLevel,
|
||||
const std::string& origin,
|
||||
const std::string& spoid,
|
||||
const std::string& origin, const std::string& spoid,
|
||||
bool atsc_mode_enabled) const;
|
||||
|
||||
Status mapAndNotifyOfCdmResponseType(const std::vector<uint8_t>& sessionId,
|
||||
CdmResponseType res);
|
||||
CdmResponseType res);
|
||||
|
||||
Status_V1_2 mapAndNotifyOfCdmResponseType_1_2(const std::vector<uint8_t>& sessionId,
|
||||
CdmResponseType res);
|
||||
Status_V1_2 mapAndNotifyOfCdmResponseType_1_2(
|
||||
const std::vector<uint8_t>& sessionId, CdmResponseType res);
|
||||
|
||||
void notifyOfCdmResponseType(const std::vector<uint8_t>& sessionId,
|
||||
CdmResponseType res);
|
||||
CdmResponseType res);
|
||||
|
||||
Status mapAndNotifyOfOEMCryptoResult(const std::vector<uint8_t>& sessionId,
|
||||
OEMCryptoResult res);
|
||||
OEMCryptoResult res);
|
||||
|
||||
Status mapOEMCryptoResult(OEMCryptoResult res);
|
||||
|
||||
SecurityLevel mapSecurityLevel(const std::string& level);
|
||||
|
||||
wvcdm::SecurityLevel getRequestedSecurityLevel() const;
|
||||
wvcdm::RequestedSecurityLevel getRequestedSecurityLevel() const;
|
||||
|
||||
Status openSessionCommon(std::vector<uint8_t>& sessionId);
|
||||
|
||||
@@ -555,4 +507,4 @@ struct WVDrmPlugin : public ::drm::V1_4::IDrmPlugin, IDrmPluginListener,
|
||||
} // namespace hardware
|
||||
} // namespace wvdrm
|
||||
|
||||
#endif // WV_DRM_PLUGIN_H_
|
||||
#endif // WV_DRM_PLUGIN_H_
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -23,7 +23,7 @@ LOCAL_C_INCLUDES := \
|
||||
LOCAL_STATIC_LIBRARIES := \
|
||||
libcdm \
|
||||
libcdm_protos \
|
||||
libcdm_utils \
|
||||
libcdm_utils_hidl \
|
||||
libjsmn \
|
||||
libgmock \
|
||||
libgmock_main \
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user