aidl plugin: add error details to return status
Merged from http://go/wvgerrit/163639 Bug: 253271674 Test: Google TV Test: atest MediaDrmParameterizedTests Test: atest DrmSessionManagerTest Change-Id: I9f0e83774d405466a389d2fd90d693830682dde4
This commit is contained in:
@@ -64,46 +64,3 @@ cc_library_static {
|
||||
|
||||
proprietary: true,
|
||||
}
|
||||
|
||||
// Builds libwvdrmcryptoplugin_aidl_fuzz
|
||||
//
|
||||
cc_library_static {
|
||||
name: "libwvdrmcryptoplugin_aidl_fuzz",
|
||||
|
||||
srcs: ["src/WVCryptoPlugin.cpp"],
|
||||
|
||||
include_dirs: [
|
||||
"frameworks/av/include",
|
||||
"frameworks/native/include",
|
||||
"vendor/widevine/libwvdrmengine/cdm/core/include",
|
||||
"vendor/widevine/libwvdrmengine/cdm/include",
|
||||
"vendor/widevine/libwvdrmengine/cdm/metrics/include",
|
||||
"vendor/widevine/libwvdrmengine/cdm/util/include",
|
||||
"vendor/widevine/libwvdrmengine/include",
|
||||
"vendor/widevine/libwvdrmengine/mediacrypto/include",
|
||||
"vendor/widevine/libwvdrmengine/oemcrypto/include",
|
||||
],
|
||||
|
||||
header_libs: [
|
||||
"libstagefright_headers",
|
||||
"libutils_headers",
|
||||
],
|
||||
|
||||
static_libs: [
|
||||
"android.hardware.common-V2-ndk",
|
||||
"libaidlcommonsupport",
|
||||
"libcdm_protos",
|
||||
],
|
||||
|
||||
shared_libs: [
|
||||
"android.hardware.drm-V1-ndk",
|
||||
"libbase",
|
||||
"libcrypto",
|
||||
"libhwbinder",
|
||||
"liblog",
|
||||
],
|
||||
|
||||
cflags: ["-Wthread-safety"],
|
||||
|
||||
proprietary: true,
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ class WVCryptoPlugin : public ::aidl::android::hardware::drm::BnCryptoPlugin {
|
||||
|
||||
::ndk::SpAIBinder createBinder() override;
|
||||
|
||||
::aidl::android::hardware::drm::Status attemptDecrypt(
|
||||
::wvdrm::WvStatus attemptDecrypt(
|
||||
const wvcdm::CdmDecryptionParametersV16& params,
|
||||
bool haveEncryptedSubsamples, std::string* errorDetailMsg);
|
||||
|
||||
|
||||
@@ -278,7 +278,7 @@ SharedBufferBase::~SharedBufferBase() {
|
||||
|
||||
// Decrypt
|
||||
std::string errorDetailMsg;
|
||||
Status res = attemptDecrypt(params, hasProtectedData, &errorDetailMsg);
|
||||
auto res = attemptDecrypt(params, hasProtectedData, &errorDetailMsg);
|
||||
native_handle_delete(handle);
|
||||
if (res != Status::OK) {
|
||||
detailedError = errorDetailMsg.data();
|
||||
@@ -296,13 +296,13 @@ SharedBufferBase::~SharedBufferBase() {
|
||||
return binder;
|
||||
}
|
||||
|
||||
Status WVCryptoPlugin::attemptDecrypt(const CdmDecryptionParametersV16& params,
|
||||
bool hasProtectedData,
|
||||
std::string* errorDetailMsg) {
|
||||
::wvdrm::WvStatus WVCryptoPlugin::attemptDecrypt(
|
||||
const CdmDecryptionParametersV16& params, bool hasProtectedData,
|
||||
std::string* errorDetailMsg) {
|
||||
CdmResponseType res = mCDM->DecryptV16(mSessionId, hasProtectedData, params);
|
||||
|
||||
if (::wvdrm::isCdmResponseTypeSuccess(res)) {
|
||||
return Status::OK;
|
||||
return ::wvdrm::WvStatus(Status::OK);
|
||||
} else {
|
||||
ALOGE("Decrypt error in session %s during a sample %s protected data: %d",
|
||||
mSessionId.c_str(), hasProtectedData ? "with" : "without", static_cast<int>(res));
|
||||
@@ -340,7 +340,7 @@ Status WVCryptoPlugin::attemptDecrypt(const CdmDecryptionParametersV16& params,
|
||||
break;
|
||||
}
|
||||
|
||||
return ::wvdrm::mapCdmResponseType<Status>(res);
|
||||
return ::wvdrm::mapCdmResponseType(res);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ LOCAL_STATIC_LIBRARIES := \
|
||||
libgmock_main \
|
||||
libgtest \
|
||||
libwvlevel3 \
|
||||
libwvdrmcryptoplugin_aidl \
|
||||
libwv_odk \
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
@@ -42,6 +41,7 @@ LOCAL_SHARED_LIBRARIES := \
|
||||
liblog \
|
||||
libprotobuf-cpp-lite \
|
||||
libutils \
|
||||
libwvaidl \
|
||||
|
||||
LOCAL_HEADER_LIBRARIES := \
|
||||
libstagefright_headers \
|
||||
|
||||
Reference in New Issue
Block a user