libwvhidl: upgrade to android.hardware.drm@1.4
Bug: 136119370 Test: GtsMediaTestCases MediaDrmTest#testRequiresSecureDecoder Change-Id: Iaaa7c225c0056904b5fd98c4557ec47f661b2c7d
This commit is contained in:
@@ -41,7 +41,7 @@ static const std::string kKeyOrigin = "origin";
|
||||
namespace wvdrm {
|
||||
namespace hardware {
|
||||
namespace drm {
|
||||
namespace V1_2 {
|
||||
namespace V1_4 {
|
||||
namespace widevine {
|
||||
|
||||
using android::hardware::drm::V1_2::widevine::toHidlVec;
|
||||
@@ -1926,6 +1926,35 @@ Return<void> WVDrmPlugin::sendSessionLostState(
|
||||
return err;
|
||||
}
|
||||
|
||||
Return<bool> WVDrmPlugin::requiresSecureDecoder(
|
||||
const hidl_string& mime, SecurityLevel level) {
|
||||
if (!strncasecmp(mime.c_str(), "video/", 6)) {
|
||||
// Type is video, so check level to see if we require a secure decoder.
|
||||
return level == SecurityLevel::HW_SECURE_ALL
|
||||
|| level == SecurityLevel::HW_SECURE_DECODE;
|
||||
} else {
|
||||
// Type is not video, so never require a secure decoder.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Return<bool> WVDrmPlugin::requiresSecureDecoderDefault(const hidl_string& mime) {
|
||||
if (!strncasecmp(mime.c_str(), "video/", 6)) {
|
||||
// Type is video, so check level to see if we require a secure decoder.
|
||||
std::string level(mPropertySet.security_level());
|
||||
|
||||
if (level == kResetSecurityLevel) {
|
||||
mCDM->QueryStatus(wvcdm::kLevelDefault,
|
||||
wvcdm::QUERY_KEY_SECURITY_LEVEL, &level);
|
||||
}
|
||||
|
||||
return level == wvcdm::QUERY_VALUE_SECURITY_LEVEL_L1;
|
||||
} else {
|
||||
// Type is not video, so never require a secure decoder.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void WVDrmPlugin::OnSessionRenewalNeeded(const CdmSessionId& cdmSessionId) {
|
||||
const std::vector<uint8_t> sessionId = StrToVector(cdmSessionId);
|
||||
const hidl_vec<uint8_t> data; // data is ignored
|
||||
@@ -2313,7 +2342,7 @@ uint32_t WVDrmPlugin::CdmIdentifierBuilder::getNextUniqueId() {
|
||||
}
|
||||
|
||||
} // namespace widevine
|
||||
} // namespace V1_2
|
||||
} // namespace V1_4
|
||||
} // namespace drm
|
||||
} // namespace hardware
|
||||
} // namespace wvdrm
|
||||
|
||||
Reference in New Issue
Block a user