Key Status should reflect key container security level

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

Callers of MediaDrm can register to be notified when key status
changes and if they are usable for decryption. A number of factors
are evaluated when making this determination. Key container security
level will now be included in the evaluation.

Bug: 78652608
Test: WV unit/integration test, GtsMediaDrmTest, Play movies playback
      testing.

Change-Id: I20243e5cb160f7957e3239e8d05f715ff0ee6dd6
This commit is contained in:
Rahul Frias
2019-05-09 13:49:47 -07:00
parent c71fb10b95
commit 7d78609548
8 changed files with 621 additions and 412 deletions

View File

@@ -45,8 +45,7 @@ class PolicyEngine {
// Verifies whether the policy allows use of the specified key of
// a given security level for content decryption.
virtual bool CanUseKeyForSecurityLevel(const KeyId& key_id,
CdmSecurityLevel security_level);
virtual bool CanUseKeyForSecurityLevel(const KeyId& key_id);
// OnTimerEvent is called when a timer fires. It notifies the Policy Engine
// that the timer has fired and dispatches the relevant events through
@@ -167,10 +166,12 @@ class PolicyEngine {
// Guard against clock rollbacks
int64_t GetCurrentTime();
// set_clock() is for testing only. It alters ownership of the
// passed-in pointer.
// Test only methods
// set_clock alters ownership of the passed-in pointer.
void set_clock(Clock* clock);
void SetSecurityLevelForTest(CdmSecurityLevel security_level);
LicenseState license_state_;
// This is the current policy information for this license. This gets updated