Correct KeySetId value when returned by AddKey

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

The MediaDrm#provideKeyResponse API states that an empty byte array is
returned when the license type is streaming or release but a non-empty
value was being returned in some cases.

The KeySetId is now returned when the license type is offline or when
the license is streaming and has a secure stop associated with it.

Test: Verified by request_license_test integration tests. Tests have been
      modified to validate the returned Key Set Id values.

b/36093612

Change-Id: I82dba537c77ddd1d1876cbce58729f3db901ee51
This commit is contained in:
Rahul Frias
2017-04-14 07:54:01 -07:00
parent ce62e1d7e7
commit 5321b96623
6 changed files with 119 additions and 72 deletions

View File

@@ -363,7 +363,13 @@ CdmResponseType CdmEngine::AddKey(const CdmSessionId& session_id,
CdmResponseType sts = iter->second->AddKey(key_data);
if (key_set_id) {
*key_set_id = iter->second->key_set_id();
if ((iter->second->is_offline() ||
iter->second->has_provider_session_token()) &&
!license_type_release) {
*key_set_id = iter->second->key_set_id();
} else {
key_set_id->clear();
}
}
switch (sts) {