wv aidl: no set security level opening default session
Bug: 219538389 Test: atest WidevineDashPolicyTests#testL3ValidateKeyOutputProtection Change-Id: I5912a93fd0b7a144694ec3b251a129d839b8b149
This commit is contained in:
@@ -263,6 +263,11 @@ SecurityLevel WVDrmPlugin::mapSecurityLevel(const std::string& level) {
|
||||
::ndk::ScopedAStatus WVDrmPlugin::openSession(SecurityLevel in_securityLevel,
|
||||
vector<uint8_t>* _aidl_return) {
|
||||
vector<uint8_t> sessionId;
|
||||
if (SecurityLevel::DEFAULT == in_securityLevel) {
|
||||
auto err = openSessionCommon(sessionId);
|
||||
*_aidl_return = sessionId;
|
||||
return toNdkScopedAStatus(err);
|
||||
}
|
||||
|
||||
if (SecurityLevel::UNKNOWN == in_securityLevel) {
|
||||
*_aidl_return = sessionId;
|
||||
@@ -279,8 +284,7 @@ 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::DEFAULT) {
|
||||
in_securityLevel >= SecurityLevel::SW_SECURE_DECODE) {
|
||||
*_aidl_return = sessionId;
|
||||
return toNdkScopedAStatus(Status::ERROR_DRM_CANNOT_HANDLE);
|
||||
}
|
||||
@@ -292,25 +296,13 @@ SecurityLevel WVDrmPlugin::mapSecurityLevel(const std::string& level) {
|
||||
|
||||
setPropertyString("securityLevel", std::string(wvcdm_security_level));
|
||||
|
||||
SecurityLevel securityLevel = in_securityLevel;
|
||||
if (SecurityLevel::DEFAULT == in_securityLevel) {
|
||||
std::string level;
|
||||
Status status = queryProperty(wvcdm::kLevelDefault,
|
||||
wvcdm::QUERY_KEY_SECURITY_LEVEL, level);
|
||||
if (status == Status::OK) {
|
||||
securityLevel = mapSecurityLevel(level);
|
||||
} else {
|
||||
ALOGE("openSession: failed to query security level, status=%d", status);
|
||||
}
|
||||
}
|
||||
|
||||
status = openSessionCommon(sessionId);
|
||||
if (Status::OK == status) {
|
||||
SecurityLevel currentSecurityLevel = SecurityLevel::UNKNOWN;
|
||||
const auto ret = getSecurityLevel(sessionId, ¤tSecurityLevel);
|
||||
if (!ret.isOk() || securityLevel != currentSecurityLevel) {
|
||||
if (!ret.isOk() || in_securityLevel != currentSecurityLevel) {
|
||||
ALOGE("Failed to open session with the requested security level=%d",
|
||||
securityLevel);
|
||||
in_securityLevel);
|
||||
closeSession(sessionId);
|
||||
sessionId.clear();
|
||||
status = Status::ERROR_DRM_INVALID_STATE;
|
||||
|
||||
Reference in New Issue
Block a user