Correct exception returned after RemoveKeys is called.
[ Merge of http://go/wvgerrit/47065 ] RemoveKeys now resets associated crypto and policy resources, rather than just closing the crypto session. This results in a MediaCodec.CryptoException with error code ERROR_NO_KEY rather than ERROR_SESSION_NOT_OPENED, if decrypt is called afterwards. Error SESSION_NOT_FOUND_FOR_DECRYPT is made unique. Error codes were also synchonized between various branches in the widevine repo. Bug: 77304819 Test: WV unit/integration tests, VtsHalDrmV1_0Target tests Change-Id: I6cba2a3e1ce466d58c7727cde2d8f81d9503d655
This commit is contained in:
@@ -875,8 +875,18 @@ bool CdmSession::StoreLicense(DeviceFiles::LicenseState state) {
|
||||
usage_entry_number_);
|
||||
}
|
||||
|
||||
CdmResponseType CdmSession::ReleaseCrypto() {
|
||||
crypto_session_->Close();
|
||||
CdmResponseType CdmSession::RemoveKeys() {
|
||||
CdmResponseType sts;
|
||||
crypto_session_.reset(new CryptoSession(crypto_metrics_));
|
||||
// Ignore errors
|
||||
M_TIME(
|
||||
sts = crypto_session_->Open(requested_security_level_),
|
||||
crypto_metrics_,
|
||||
crypto_session_open_,
|
||||
sts,
|
||||
requested_security_level_);
|
||||
policy_engine_.reset(new PolicyEngine(
|
||||
session_id_, NULL, crypto_session_.get()));
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user