Generate key set ID on initialization and interface clean up

This is a merge of squashed CLs.

* Cdm Session and Engine interface clean up

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

Key Set Ids have been removed from the CdmSession interface
(GenerateKeyRequest, Addkey) as they can be queried by an accessor.

The CdmEngine interface now allows one to specify or retrieve a session ID,
since both were not being used in a single call. Key set IDs are no longer
returned though GenerateKeyRequest as they was not being used.

* Generate key set ID when session is initialized

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

Key set IDs are currently generated at different times in the
CdmSession lifecycle. Android generates key set IDs when the license
is received, while the CE CDM generates (or overrides them)
when the session is constructed.

The key set IDs are now generated when the session is initialized.
Key set generation cannot occur earlier as it has a dependency on
security level and in turn on crypto session initialization which
occurs when the session is initialized.

Depenencies on Session ID has caused other activities, construction of
PolicyEngine, CdmLicense, setting property CDM client sets to be
deferred from CdmSession constructor to Init().

Android will still retrieve the key set IDs after the offline license is
processed. For streaming requests, the key set will be
unreserved and discarded when the session is terminated.

Change-Id: Ib802d1c043742d62efa9a2c901fcd113e836c33d
This commit is contained in:
Rahul Frias
2016-01-15 17:01:38 -08:00
parent d2dc2e3670
commit 84a14f2561
11 changed files with 153 additions and 153 deletions

View File

@@ -183,7 +183,8 @@ enum {
kSessionNotFound11 = ERROR_DRM_VENDOR_MIN + 169,
kLoadUsageInfoFileError = ERROR_DRM_VENDOR_MIN + 170,
kLoadUsageInfoMissing = ERROR_DRM_VENDOR_MIN + 171,
kErrorWVDrmMaxErrorUsed = ERROR_DRM_VENDOR_MIN + 171,
kSessionFileHandleInitError = ERROR_DRM_VENDOR_MIN + 172,
kErrorWVDrmMaxErrorUsed = ERROR_DRM_VENDOR_MIN + 172,
// Used by crypto test mode
kErrorTestMode = ERROR_DRM_VENDOR_MAX,

View File

@@ -233,12 +233,8 @@ static android::status_t mapCdmResponseType(wvcdm::CdmResponseType res) {
return kRenewKeyError2;
case wvcdm::LICENSE_RENEWAL_SIGNING_ERROR:
return kLicenseRenewalSigningError;
case wvcdm::RESTORE_OFFLINE_LICENSE_ERROR_1:
return kRestoreOfflineLicenseError1;
case wvcdm::RESTORE_OFFLINE_LICENSE_ERROR_2:
return kRestoreOfflineLicenseError2;
case wvcdm::SESSION_INIT_ERROR_1:
return kSessionInitError1;
case wvcdm::SESSION_INIT_ERROR_2:
return kSessionInitError2;
case wvcdm::SESSION_INIT_GET_KEYBOX_ERROR:
@@ -271,8 +267,6 @@ static android::status_t mapCdmResponseType(wvcdm::CdmResponseType res) {
return kStoreLicenseError1;
case wvcdm::STORE_LICENSE_ERROR_2:
return kStoreLicenseError2;
case wvcdm::STORE_LICENSE_ERROR_3:
return kStoreLicenseError3;
case wvcdm::STORE_USAGE_INFO_ERROR:
return kStoreUsageInfoError;
case wvcdm::UNPROVISION_ERROR_1:
@@ -355,6 +349,8 @@ static android::status_t mapCdmResponseType(wvcdm::CdmResponseType res) {
return kLoadUsageInfoFileError;
case wvcdm::LOAD_USAGE_INFO_MISSING:
return kLoadUsageInfoMissing;
case wvcdm::SESSION_FILE_HANDLE_INIT_ERROR:
return kSessionFileHandleInitError;
case wvcdm::UNKNOWN_ERROR:
return android::ERROR_DRM_UNKNOWN;
case wvcdm::SECURE_BUFFER_REQUIRED:
@@ -362,6 +358,9 @@ static android::status_t mapCdmResponseType(wvcdm::CdmResponseType res) {
case wvcdm::UNUSED_1:
case wvcdm::UNUSED_2:
case wvcdm::UNUSED_3:
case wvcdm::UNUSED_4:
case wvcdm::UNUSED_5:
case wvcdm::UNUSED_6:
return android::UNKNOWN_ERROR;
}