Fix mapCdmResponseType template.

Merged from http://go/wvgerrit/163457

mapCdmResponseType is called either with an enum or
a CdmResponseType struct.

Test: build android.hardware.drm-service.widevine
Test: Netflix and Play Movies & TV
Test: build_and_run_all_unit_tests.sh
Test: atest MediaDrmParameterizedTests
Test: atest DrmSessionManagerTest

Bug: 253271674
Bug: 262210157
Change-Id: Ieb9fccf33f54a98c67ddf7655d2a5ada7a946114
This commit is contained in:
Edwin Wong
2022-12-12 18:14:00 +00:00
parent 096b0eda5a
commit b1fd332cc5

View File

@@ -16,11 +16,6 @@ namespace wvdrm {
using ::aidl::android::hardware::drm::Status;
template <typename S = Status>
static S mapCdmResponseType(wvcdm::CdmResponseType res) {
return mapCdmResponseType(static_cast<wvcdm::CdmResponseType>(res));
}
template <typename S = Status>
static S mapCdmResponseType(wvcdm::CdmResponseEnum res) {
Status err = Status::ERROR_DRM_UNKNOWN;
@@ -439,6 +434,11 @@ static S mapCdmResponseType(wvcdm::CdmResponseEnum res) {
return static_cast<S>(err);
}
template <typename S = Status>
static S mapCdmResponseType(wvcdm::CdmResponseType res) {
return mapCdmResponseType(static_cast<wvcdm::CdmResponseEnum>(res));
}
static inline bool isCdmResponseTypeSuccess(wvcdm::CdmResponseType res) {
return mapCdmResponseType(res) == Status::OK;
}