Implement MediaDrm offline license support in Widevine hidl service.

Merged from http://go/wvgerrit/69723.

The new APIs are getOfflineLicenseIds, getOfflineLicenseState and
removeOfflineLicense. These methods are currently stubbed out in
Widevine hidl service. This CL completes the implementation.

Test: unit tests - libwvdrmdrmplugin_hidl_test

Test: GTS
  --test com.google.android.media.gts.MediaDrmTest#testWidevineApi29

bug: 117570686
Change-Id: I96ffb75f453e36e931effefd3664b5faa8d69d30
This commit is contained in:
Edwin Wong
2019-01-21 17:07:43 -08:00
parent 19c4996b3c
commit 54104c7a22
12 changed files with 462 additions and 30 deletions

View File

@@ -63,6 +63,7 @@ static Status mapCdmResponseType(wvcdm::CdmResponseType res) {
case wvcdm::SESSION_NOT_FOUND_18:
case wvcdm::SESSION_NOT_FOUND_19:
case wvcdm::SESSION_NOT_FOUND_20:
case wvcdm::SESSION_NOT_FOUND_21:
return Status::ERROR_DRM_SESSION_NOT_OPENED;
case wvcdm::DECRYPT_ERROR:
@@ -321,6 +322,10 @@ static Status mapCdmResponseType(wvcdm::CdmResponseType res) {
case wvcdm::INVALID_LICENSE_TYPE_2:
case wvcdm::SIGNATURE_NOT_FOUND_2:
case wvcdm::SESSION_KEYS_NOT_FOUND_2:
case wvcdm::GET_OFFLINE_LICENSE_STATE_ERROR_1:
case wvcdm::GET_OFFLINE_LICENSE_STATE_ERROR_2:
case wvcdm::REMOVE_OFFLINE_LICENSE_ERROR_1:
case wvcdm::REMOVE_OFFLINE_LICENSE_ERROR_2:
ALOGW("Returns UNKNOWN error for legacy status: %d", res);
return Status::ERROR_DRM_UNKNOWN;