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

@@ -235,6 +235,7 @@ static android::status_t 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 android::ERROR_DRM_SESSION_NOT_OPENED;
case wvcdm::SESSION_KEYS_NOT_FOUND:
return kSessionKeysNotFound;
@@ -557,6 +558,15 @@ static android::status_t mapCdmResponseType(wvcdm::CdmResponseType res) {
return kSignatureNotFound2;
case wvcdm::SESSION_KEYS_NOT_FOUND_2:
return kSessionKeysNotFound2;
// This error is only returned in API 29 by the hidl service.
// It should never be used in the legacy plugin.
// It is mapped here to clear the compiler warning.
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:
return android::ERROR_DRM_UNKNOWN;
}
// Return here instead of as a default case so that the compiler will warn