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

Commit be32a246 authored by Mikhail Naganov's avatar Mikhail Naganov Committed by Android (Google) Code Review
Browse files

Merge "audio: Add support for dumping info from effect HAL modules"

parents cfe17322 4d54767b
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
//#define LOG_NDEBUG 0

#include <common/all-versions/VersionUtils.h>
#include <cutils/native_handle.h>
#include <hwbinder/IPCThreadState.h>
#include <media/EffectsFactoryApi.h>
#include <utils/Log.h>
@@ -280,6 +281,15 @@ status_t EffectHalHidl::close() {
    return ret.isOk() ? analyzeResult(ret) : FAILED_TRANSACTION;
}

status_t EffectHalHidl::dump(int fd) {
    if (mEffect == 0) return NO_INIT;
    native_handle_t* hidlHandle = native_handle_create(1, 0);
    hidlHandle->data[0] = fd;
    Return<void> ret = mEffect->debug(hidlHandle, {} /* options */);
    native_handle_delete(hidlHandle);
    return ret.isOk() ? OK : FAILED_TRANSACTION;
}

status_t EffectHalHidl::getConfigImpl(
        uint32_t cmdCode, uint32_t *replySize, void *pReplyData) {
    if (replySize == NULL || *replySize != sizeof(effect_config_t) || pReplyData == NULL) {
+2 −0
Original line number Diff line number Diff line
@@ -61,6 +61,8 @@ class EffectHalHidl : public EffectHalInterface
    // Whether it's a local implementation.
    virtual bool isLocal() const { return false; }

    virtual status_t dump(int fd);

    uint64_t effectId() const { return mEffectId; }

    static void effectDescriptorToHal(
+2 −0
Original line number Diff line number Diff line
@@ -55,6 +55,8 @@ class EffectHalInterface : public RefBase
    // Whether it's a local implementation.
    virtual bool isLocal() const = 0;

    virtual status_t dump(int fd) = 0;

  protected:
    // Subclasses can not be constructed directly by clients.
    EffectHalInterface() {}
+5 −0
Original line number Diff line number Diff line
@@ -1500,6 +1500,11 @@ void AudioFlinger::EffectModule::dump(int fd, const Vector<String16>& args __unu

    write(fd, result.string(), result.length());

    if (mEffectInterface != 0) {
        dprintf(fd, "\tEffect ID %d HAL dump:\n", mId);
        (void)mEffectInterface->dump(fd);
    }

    if (locked) {
        mLock.unlock();
    }