Correct CryptoException error returned before keys have been loaded

[ Merge of http://go/wvgerrit/25983 ]

Earlier versions of android returned CryptoException with
error code ERROR_NO_KEY, when a decrypt call was received before keys were
loaded. Changes to O resulted in ERROR_SESSION_NOT_OPENED being returned
instead. This CL reverts the behaviour.

Also a change to correct CDM error code numbering in comments.

Test: Verified by unit and integration tests

b/37219830

Change-Id: I43758cd29cf9d1945f878ac352a5f26538b48cdb
This commit is contained in:
Rahul Frias
2017-04-15 02:06:02 -07:00
parent 80798ae11c
commit 3d599197be
6 changed files with 40 additions and 31 deletions

View File

@@ -379,10 +379,7 @@ CdmResponseType WvContentDecryptionModule::Decrypt(
cdm_engine->GetMetrics(),
cdm_engine_find_session_for_key_,
status);
if (!status) {
LOGE("WvContentDecryptionModule::Decrypt: unable to find session");
return SESSION_NOT_FOUND_FOR_DECRYPT;
}
if (!status) return KEY_NOT_FOUND_IN_SESSION;
}
CdmResponseType sts;
M_TIME(