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

Commit 9afca95a authored by Robert Shih's avatar Robert Shih
Browse files

IDrm/ICrypto: implement getLogMessages

Bug: 162255728
Test: build
Change-Id: I68edcd04729a5721117e13a48304b842a61dfee5
parent 5944a0be
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ cc_library {
        "android.hardware.drm@1.0",
        "android.hardware.drm@1.1",
        "android.hardware.drm@1.2",
        "android.hardware.drm@1.4",
    ],

    cflags: [
+4 −0
Original line number Diff line number Diff line
@@ -393,4 +393,8 @@ status_t CryptoHal::setMediaDrmSession(const Vector<uint8_t> &sessionId) {
    return toStatusT(mPlugin->setMediaDrmSession(toHidlVec(sessionId)));
}

status_t CryptoHal::getLogMessages(Vector<drm::V1_4::LogMessage> &logs) const {
    Mutex::Autolock autoLock(mLock);
    return DrmUtils::GetLogMessages<drm::V1_4::ICryptoPlugin>(mPlugin, logs);
}
}  // namespace android
+5 −0
Original line number Diff line number Diff line
@@ -1545,4 +1545,9 @@ status_t DrmHal::setPlaybackId(Vector<uint8_t> const &sessionId, const char *pla
    return toStatusT(err);
}

status_t DrmHal::getLogMessages(Vector<drm::V1_4::LogMessage> &logs) const {
    Mutex::Autolock autoLock(mLock);
    return DrmUtils::GetLogMessages<drm::V1_4::IDrmPlugin>(mPlugin, logs);
}

}  // namespace android
+3 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include <android/hardware/drm/1.0/ICryptoPlugin.h>
#include <android/hardware/drm/1.1/ICryptoFactory.h>
#include <android/hardware/drm/1.2/ICryptoPlugin.h>
#include <android/hardware/drm/1.4/ICryptoPlugin.h>

#include <mediadrm/ICrypto.h>
#include <utils/KeyedVector.h>
@@ -71,6 +72,8 @@ struct CryptoHal : public ICrypto {
    }
    virtual void unsetHeap(int32_t seqNum) { clearHeapBase(seqNum); }

    virtual status_t getLogMessages(Vector<drm::V1_4::LogMessage> &logs) const;

private:
    mutable Mutex mLock;

+3 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
#include <android/hardware/drm/1.2/IDrmPlugin.h>
#include <android/hardware/drm/1.2/IDrmPluginListener.h>
#include <android/hardware/drm/1.4/IDrmPlugin.h>
#include <android/hardware/drm/1.4/types.h>

#include <media/drm/DrmAPI.h>
#include <mediadrm/DrmMetrics.h>
@@ -188,6 +189,8 @@ struct DrmHal : public IDrm,
            Vector<uint8_t> const &sessionId,
            const char *playbackId);

    virtual status_t getLogMessages(Vector<drm::V1_4::LogMessage> &logs) const;

    // Methods of IDrmPluginListener
    Return<void> sendEvent(EventType eventType,
            const hidl_vec<uint8_t>& sessionId, const hidl_vec<uint8_t>& data);
Loading