Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 899253a8 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Remove false warning message while extracting memory" into main am:...

Merge "Remove false warning message while extracting memory" into main am: e7400713 am: 1110775f

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3503697



Change-Id: I0f52c43de8227fc67d99134f8f001c23997a46a2
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 91237b59 1110775f
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -2990,11 +2990,16 @@ static void extractMemoryFromContext(
        }
        *memory = context->toHidlMemory();
    }
    if (context->mBlock == nullptr || context->mReadWriteMapping == nullptr) {
        ALOGW("extractMemoryFromContext: Cannot extract memory as C2Block is not created/mapped");
    if (context->mBlock == nullptr) {
        // this should be ok as we may only have IMemory/hidlMemory
        // e.g. video codecs may only have IMemory and no mBlock
        return;
    }
    if (context->mReadWriteMapping->error() != C2_OK) {

    // if we have mBlock and memory, then we will copy data from mBlock to hidlMemory
    // e.g. audio codecs may only have mBlock and wanted to decrypt using hidlMemory
    // and also wanted to re-use mBlock
    if (context->mReadWriteMapping == nullptr || context->mReadWriteMapping->error() != C2_OK) {
        ALOGW("extractMemoryFromContext: failed to map C2Block (%d)",
                context->mReadWriteMapping->error());
        return;