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

Commit 758ebb9a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "cas: retrieve detailed error from descrambler"

parents 96a76b8f 521f6955
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -23,10 +23,10 @@ cc_defaults {
      "libhidlmemory",
      "libhidltransport",
      "liblog",
      "libstagefright_foundation",
      "libutils",
    ],
    header_libs: [
      "libstagefright_foundation_headers",
      "media_plugin_headers",
    ],
}
+4 −2
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include <hidlmemory/mapping.h>
#include <media/cas/DescramblerAPI.h>
#include <media/hardware/CryptoAPI.h>
#include <media/stagefright/foundation/AString.h>
#include <media/stagefright/foundation/AUtils.h>
#include <utils/Log.h>

@@ -177,6 +178,7 @@ Return<void> DescramblerImpl::descramble(
    // Casting hidl SubSample to DescramblerPlugin::SubSample, but need
    // to ensure structs are actually idential

    AString detailedError;
    int32_t result = holder->descramble(
            dstBuffer.type != BufferType::SHARED_MEMORY,
            (DescramblerPlugin::ScramblingControl)scramblingControl,
@@ -186,10 +188,10 @@ Return<void> DescramblerImpl::descramble(
            srcOffset,
            dstPtr,
            dstOffset,
            NULL);
            &detailedError);

    holder.reset();
    _hidl_cb(toStatus(result >= 0 ? OK : result), result, NULL);
    _hidl_cb(toStatus(result >= 0 ? OK : result), result, detailedError.c_str());
    return Void();
}