Add recoverable errors
[ Merge of http://go/wvgerrit/71326 ] Nonce flood, frame size, session and system invalidation errors will now bubble up to the app. OEMCrypto v15 returns OEMCrypto_ERROR_BUFFER_TOO_LARGE, OEMCrypto_ERROR_SESSION_LOST_STATE, OEMCrypto_ERROR_SYSTEM_INVALIDATED and a variety of nonce errors. These will be reported to HIDL as OUTPUT_TOO_LARGE_ERROR, ERROR_DRM_SESSION_LOST_STATE, ERROR_DRM_INVALID_STATE and ERROR_DRM_RESOURCE_CONTENTION. Bug: 120572706 Test: Unit/Integration tests Change-Id: Ida177300046327ce81592a273028ef6c3a0d9fd9
This commit is contained in:
@@ -90,9 +90,11 @@ CdmResponseType ClientIdentification::Prepare(
|
||||
client_id->set_type(token_type);
|
||||
|
||||
std::string token;
|
||||
if (!crypto_session_->GetProvisioningToken(&token)) {
|
||||
LOGE("ClientIdentification::Prepare: failure getting provisioning token");
|
||||
return CLIENT_IDENTIFICATION_TOKEN_ERROR_2;
|
||||
CdmResponseType status = crypto_session_->GetProvisioningToken(&token);
|
||||
if (status != NO_ERROR) {
|
||||
LOGE("ClientIdentification::Prepare: failure getting provisioning token: "
|
||||
"%d", status);
|
||||
return status;
|
||||
}
|
||||
client_id->set_token(token);
|
||||
}
|
||||
@@ -172,7 +174,8 @@ CdmResponseType ClientIdentification::Prepare(
|
||||
|
||||
if (is_license_request_) {
|
||||
CryptoSession::HdcpCapability current_version, max_version;
|
||||
if (crypto_session_->GetHdcpCapabilities(¤t_version, &max_version)) {
|
||||
if (crypto_session_->GetHdcpCapabilities(¤t_version, &max_version) ==
|
||||
NO_ERROR) {
|
||||
switch (max_version) {
|
||||
case HDCP_NONE:
|
||||
client_capabilities->set_max_hdcp_version(
|
||||
@@ -235,7 +238,7 @@ CdmResponseType ClientIdentification::Prepare(
|
||||
client_capabilities->set_can_update_srm(
|
||||
crypto_session_->IsSrmUpdateSupported());
|
||||
uint16_t srm_version;
|
||||
if (crypto_session_->GetSrmVersion(&srm_version))
|
||||
if (crypto_session_->GetSrmVersion(&srm_version) == NO_ERROR)
|
||||
client_capabilities->set_srm_version(srm_version);
|
||||
}
|
||||
bool can_support_output;
|
||||
|
||||
Reference in New Issue
Block a user