Merge "Update usage table when session is closed"
This commit is contained in:
@@ -122,6 +122,7 @@ class CryptoSession {
|
|||||||
static int session_count_;
|
static int session_count_;
|
||||||
|
|
||||||
bool open_;
|
bool open_;
|
||||||
|
bool update_usage_table_after_close_session_;
|
||||||
CryptoSessionId oec_session_id_;
|
CryptoSessionId oec_session_id_;
|
||||||
|
|
||||||
OEMCryptoBufferType destination_buffer_type_;
|
OEMCryptoBufferType destination_buffer_type_;
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ uint64_t CryptoSession::request_id_index_ = 0;
|
|||||||
|
|
||||||
CryptoSession::CryptoSession()
|
CryptoSession::CryptoSession()
|
||||||
: open_(false),
|
: open_(false),
|
||||||
|
update_usage_table_after_close_session_(false),
|
||||||
is_destination_buffer_type_valid_(false),
|
is_destination_buffer_type_valid_(false),
|
||||||
requested_security_level_(kLevelDefault),
|
requested_security_level_(kLevelDefault),
|
||||||
request_id_base_(0) {
|
request_id_base_(0) {
|
||||||
@@ -270,6 +271,11 @@ void CryptoSession::Close() {
|
|||||||
if (!open_) return;
|
if (!open_) return;
|
||||||
if (OEMCrypto_SUCCESS == OEMCrypto_CloseSession(oec_session_id_)) {
|
if (OEMCrypto_SUCCESS == OEMCrypto_CloseSession(oec_session_id_)) {
|
||||||
open_ = false;
|
open_ = false;
|
||||||
|
if (update_usage_table_after_close_session_) {
|
||||||
|
OEMCryptoResult sts = OEMCrypto_UpdateUsageTable();
|
||||||
|
if (sts != OEMCrypto_SUCCESS)
|
||||||
|
LOGW("CryptoSession::Close: OEMCrypto_UpdateUsageTable error=%ld", sts);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -422,6 +428,7 @@ CdmResponseType CryptoSession::LoadKeys(
|
|||||||
|
|
||||||
if (OEMCrypto_SUCCESS == sts) {
|
if (OEMCrypto_SUCCESS == sts) {
|
||||||
if (!provider_session_token.empty()) {
|
if (!provider_session_token.empty()) {
|
||||||
|
update_usage_table_after_close_session_ = true;
|
||||||
sts = OEMCrypto_UpdateUsageTable();
|
sts = OEMCrypto_UpdateUsageTable();
|
||||||
if (sts != OEMCrypto_SUCCESS) {
|
if (sts != OEMCrypto_SUCCESS) {
|
||||||
LOGW("CryptoSession::LoadKeys: OEMCrypto_UpdateUsageTable error=%ld",
|
LOGW("CryptoSession::LoadKeys: OEMCrypto_UpdateUsageTable error=%ld",
|
||||||
|
|||||||
Reference in New Issue
Block a user