misc wv aidl bug fix to pass vts

* handle default security level
* init ScopedAStatus before sending events

Bug: 205845199
Test: atest VtsAidlHalDrmTargetTest
Change-Id: Ie72d837bb2b7caa1da2721262b76bd47d5bdab03
This commit is contained in:
Robert Shih
2022-02-01 23:21:28 -08:00
parent 3c3da01d58
commit f1bfd6f202

View File

@@ -279,7 +279,8 @@ SecurityLevel WVDrmPlugin::mapSecurityLevel(const std::string& level) {
}
if (wvcdm::QUERY_VALUE_SECURITY_LEVEL_L3 == native_security_level &&
in_securityLevel >= SecurityLevel::SW_SECURE_DECODE) {
in_securityLevel >= SecurityLevel::SW_SECURE_DECODE &&
in_securityLevel != SecurityLevel::DEFAULT) {
*_aidl_return = sessionId;
return toNdkScopedAStatus(Status::ERROR_DRM_CANNOT_HANDLE);
}
@@ -1704,7 +1705,7 @@ void WVDrmPlugin::sendEvent(
void WVDrmPlugin::sendExpirationUpdate(const vector<uint8_t>& in_sessionId,
int64_t in_expiryTimeInMS) {
::ndk::ScopedAStatus err;
::ndk::ScopedAStatus err = ::ndk::ScopedAStatus::ok();
if (mListener != nullptr) {
err = mListener->onExpirationUpdate(in_sessionId, in_expiryTimeInMS);
} else {
@@ -1720,7 +1721,7 @@ void WVDrmPlugin::sendKeysChange(
const vector<uint8_t>& in_sessionId,
const vector<::aidl::android::hardware::drm::KeyStatus>& in_keyStatusList,
bool in_hasNewUsableKey) {
::ndk::ScopedAStatus err;
::ndk::ScopedAStatus err = ::ndk::ScopedAStatus::ok();
if (mListener != nullptr) {
err = mListener->onKeysChange(in_sessionId, in_keyStatusList,
in_hasNewUsableKey);
@@ -1734,7 +1735,7 @@ void WVDrmPlugin::sendKeysChange(
}
void WVDrmPlugin::sendSessionLostState(const vector<uint8_t>& in_sessionId) {
::ndk::ScopedAStatus err;
::ndk::ScopedAStatus err = ::ndk::ScopedAStatus::ok();
if (mListener != nullptr) {
err = mListener->onSessionLostState(in_sessionId);
} else {