Revert "Create unique cdm engines per WVDrmPlugin instance"
This change introduced b/77618383, need to revert.
This reverts commit 58234a69f2.
Change-Id: Ie7d515bcd94f2dcee6fa9b885cd0441845c82c22
Bug: 77618383
This commit is contained in:
committed by
Patrick Egloff
parent
58234a69f2
commit
90441e24df
@@ -14,7 +14,6 @@
|
||||
|
||||
#include "mapErrors-inl.h"
|
||||
#include "media/stagefright/MediaErrors.h"
|
||||
#include "metrics.pb.h"
|
||||
#include "openssl/sha.h"
|
||||
#include "wv_cdm_constants.h"
|
||||
|
||||
@@ -140,16 +139,6 @@ WVDrmPlugin::~WVDrmPlugin() {
|
||||
}
|
||||
}
|
||||
mCryptoSessions.clear();
|
||||
CdmIdentifier identifier;
|
||||
Status status = mCdmIdentifierBuilder.getCdmIdentifier(&identifier);
|
||||
if (status != Status::OK) {
|
||||
ALOGE("Failed to get cdm identifier %d", status);
|
||||
} else {
|
||||
status = mapCdmResponseType(mCDM->CloseCdm(identifier));
|
||||
if (status != Status::OK) {
|
||||
ALOGE("Failed to get close cdm %d", status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Status WVDrmPlugin::openSessionCommon(std::vector<uint8_t>& sessionId) {
|
||||
@@ -627,7 +616,7 @@ Return<void> WVDrmPlugin::provideProvisionResponse(
|
||||
|
||||
CdmProvisioningResponse cdmResponse(resp.begin(), resp.end());
|
||||
if (cdmResponse == kSpecialUnprovisionResponse) {
|
||||
if (identifier.IsEquivalentToDefault()) {
|
||||
if (identifier == kDefaultCdmIdentifier) {
|
||||
ALOGW("Returns UNKNOWN error for legacy status kErrorNoOriginSpecified");
|
||||
_hidl_cb(Status::ERROR_DRM_UNKNOWN, toHidlVec(certificate),
|
||||
toHidlVec(wrappedKey));
|
||||
@@ -995,27 +984,9 @@ Return<void> WVDrmPlugin::getPropertyByteArray(
|
||||
} else if (name == "serviceCertificate") {
|
||||
value = StrToVector(mPropertySet.service_certificate());
|
||||
} else if (name == "metrics") {
|
||||
drm_metrics::WvCdmMetrics metrics;
|
||||
// If the cdm identifier is not yet sealed, then there are no metrics
|
||||
// for that cdm engine. Avoid calling getCdmIdentifier and sealing
|
||||
// the identifier builder.
|
||||
if (mCdmIdentifierBuilder.is_sealed()) {
|
||||
CdmIdentifier identifier;
|
||||
status = mCdmIdentifierBuilder.getCdmIdentifier(&identifier);
|
||||
if (status != Status::OK) {
|
||||
ALOGE("Unexpected error retrieving cdm identifier: %d", status);
|
||||
} else {
|
||||
status = mapCdmResponseType(mCDM->GetMetrics(identifier, &metrics));
|
||||
}
|
||||
}
|
||||
if (status == Status::OK) {
|
||||
std::string serialized_metrics;
|
||||
if (!metrics.SerializeToString(&serialized_metrics)) {
|
||||
status = Status::ERROR_DRM_UNKNOWN;
|
||||
} else {
|
||||
value = StrToVector(serialized_metrics);
|
||||
}
|
||||
}
|
||||
std::string metrics_value;
|
||||
mCDM->GetSerializedMetrics(&metrics_value);
|
||||
value = StrToVector(metrics_value);
|
||||
} else {
|
||||
ALOGE("App requested unknown byte array property %s", name.c_str());
|
||||
status = Status::ERROR_DRM_CANNOT_HANDLE;
|
||||
@@ -1670,7 +1641,6 @@ WVDrmPlugin::CdmIdentifierBuilder::CdmIdentifierBuilder(
|
||||
mAppPackageName(appPackageName),
|
||||
mParent(parent) {
|
||||
mCdmIdentifier.app_package_name = mAppPackageName;
|
||||
mCdmIdentifier.unique_id = getNextUniqueId();
|
||||
}
|
||||
|
||||
Status WVDrmPlugin::CdmIdentifierBuilder::getCdmIdentifier(
|
||||
@@ -1678,6 +1648,7 @@ Status WVDrmPlugin::CdmIdentifierBuilder::getCdmIdentifier(
|
||||
if (!mIsIdentifierSealed) {
|
||||
Status res = calculateSpoid();
|
||||
if (res != Status::OK) return res;
|
||||
|
||||
mIsIdentifierSealed = true;
|
||||
}
|
||||
*identifier = mCdmIdentifier;
|
||||
@@ -1746,12 +1717,6 @@ Status WVDrmPlugin::CdmIdentifierBuilder::getOemcryptoDeviceId(
|
||||
return mParent.queryProperty(wvcdm::QUERY_KEY_DEVICE_ID, *id);
|
||||
}
|
||||
|
||||
uint32_t WVDrmPlugin::CdmIdentifierBuilder::getNextUniqueId() {
|
||||
// Start with 1. 0 is reserved for the default cdm identifier.
|
||||
static uint32_t unique_id = 1;
|
||||
return ++unique_id;
|
||||
}
|
||||
|
||||
} // namespace widevine
|
||||
} // namespace V1_1
|
||||
} // namespace drm
|
||||
|
||||
Reference in New Issue
Block a user