Merge "Clear sessionId regardless of what closeSession returns" into rvc-dev

This commit is contained in:
Edwin Wong
2020-03-14 00:01:36 +00:00
committed by Android (Google) Code Review

View File

@@ -334,11 +334,13 @@ Return<void> WVDrmPlugin::openSession_1_1(
hidl_vec<uint8_t> hSessionId = toHidlVec(sessionId);
if (Status::OK == status) {
SecurityLevel currentSecurityLevel = SecurityLevel::UNKNOWN;
Return<void> hResult = getSecurityLevel(hSessionId, [&](Status status, SecurityLevel hSecurityLevel) {
Return<void> hResult = getSecurityLevel(
hSessionId, [&](Status gslStatus, SecurityLevel hSecurityLevel) {
currentSecurityLevel = hSecurityLevel;
if (Status::OK != status || requestedLevel != hSecurityLevel) {
if (Status::OK != gslStatus || requestedLevel != hSecurityLevel) {
ALOGE("Failed to open session with the requested security level=%d", requestedLevel);
if (Status::OK != closeSession(hSessionId)) sessionId.clear();
closeSession(hSessionId);
sessionId.clear();
}
});
if (!hResult.isOk() || (requestedLevel != currentSecurityLevel)) {