Add HDCP cap logging on HDCP-based failures.

[ Merge of http://go/wvgerrit/178872 ]
[ Cherry-pick of http://ag/24047535 ]

Partners have requested that we log HDCP information during certain
operation:
1) Current and max HDCP capability when calls to decrypt or select
   key failure due to insufficient or mixed HDCP levels.
2) Current, desired and default HDCP level when video contraints
   are not met.

To avoid spamming the logs, decrypt failures are only logged on their
first occurrence, and unmet video constrains when one of the
requirements change.

Bug: 276686656
Test: license_keys_unittest
Test: Android WVTS on oriole
Change-Id: I98b18e66d7ce1c474a018ae83af4f1c0b03308df
This commit is contained in:
Alex Dale
2023-07-12 16:37:09 -07:00
parent bb925c46e5
commit c84b9afd38
4 changed files with 113 additions and 6 deletions

View File

@@ -69,6 +69,8 @@ class CryptoSession {
static CryptoSession* MakeCryptoSession(
metrics::CryptoMetrics* crypto_metrics);
static const char* HdcpCapabilityToString(HdcpCapability hdcp_level);
virtual ~CryptoSession();
// This method will try to terminate OEMCrypto if |session_size_| is 0.
@@ -545,6 +547,9 @@ class CryptoSession {
// same error code in sequence of each other. A value of
// OEMCrypto_SUCCESS indicates that no error have yet occurred.
OEMCryptoResult last_decrypt_error_ = OEMCrypto_SUCCESS;
// Similar to |last_decrypt_error_|, but intended for calls to
// SelectKey().
OEMCryptoResult last_select_key_error_ = OEMCrypto_SUCCESS;
// In order to avoid creating a deadlock if instantiation needs to take any
// of the CryptoSession static mutexes, |factory_| is protected by its own