Merge "Fix GTS testL3PlayHDCPV* tests." into oc-dev am: dcf78b1062

am: fd71455558

Change-Id: Id0bb03cd4f1c3b1b1896a6bdeb643bc9a7539aac
This commit is contained in:
Edwin Wong
2017-05-13 04:22:00 +00:00
committed by android-build-merger
2 changed files with 12 additions and 3 deletions

View File

@@ -99,6 +99,10 @@ class PolicyEngine {
bool CanRenew() { return policy_.can_renew(); }
bool IsSufficientOutputProtection(const KeyId& key_id) {
return license_keys_->MeetsConstraints(key_id);
}
private:
friend class PolicyEngineTest;
friend class PolicyEngineConstraintsTest;

View File

@@ -551,9 +551,14 @@ CdmResponseType CdmSession::Decrypt(const CdmDecryptionParameters& params) {
// Playback may not begin until either the start time passes or the license
// is updated, so we treat this Decrypt call as invalid.
if (params.is_encrypted &&
!policy_engine_->CanDecryptContent(*params.key_id)) {
return policy_engine_->IsLicenseForFuture() ? DECRYPT_NOT_READY : NEED_KEY;
if (params.is_encrypted) {
if (!policy_engine_->CanDecryptContent(*params.key_id)) {
if (policy_engine_->IsLicenseForFuture())
return DECRYPT_NOT_READY;
if (!policy_engine_->IsSufficientOutputProtection(*params.key_id))
return INSUFFICIENT_OUTPUT_PROTECTION;
return NEED_KEY;
}
}
CdmResponseType status = crypto_session_->Decrypt(params);