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

Commit b607ad38 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "audio: add dump on Streams, StreamWrapper and Module." into main

parents 4b3f468e 450f5405
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -612,6 +612,15 @@ ndk::ScopedAStatus Module::updateStreamsConnectedState(const AudioPatch& oldPatc
    return ndk::ScopedAStatus::ok();
}

binder_status_t Module::dump(int fd, const char** args, uint32_t numArgs) {
    for (const auto& portConfig : getConfig().portConfigs) {
        if (portConfig.ext.getTag() == AudioPortExt::Tag::mix) {
            getStreams().dump(portConfig.id, fd, args, numArgs);
        }
    }
    return STATUS_OK;
}

ndk::ScopedAStatus Module::setModuleDebug(
        const ::aidl::android::hardware::audio::core::ModuleDebug& in_debug) {
    LOG(DEBUG) << __func__ << ": " << mType << ": old flags:" << mDebug.toString()
+2 −0
Original line number Diff line number Diff line
@@ -61,6 +61,8 @@ class Module : public BnModule {
    // The vendor extension done via inheritance can override interface methods and augment
    // a call to the base implementation.

    binder_status_t dump(int fd, const char** args, uint32_t numArgs) override;

    ndk::ScopedAStatus setModuleDebug(
            const ::aidl::android::hardware::audio::core::ModuleDebug& in_debug) override;
    ndk::ScopedAStatus getTelephony(std::shared_ptr<ITelephony>* _aidl_return) override;
+12 −0
Original line number Diff line number Diff line
@@ -653,6 +653,12 @@ class StreamWrapper {
        return ndk::ScopedAStatus::ok();
    }

    void dump(int fd, const char** args, uint32_t numArgs) const {
        auto s = ::ndk::ICInterface::asInterface(mStreamBinder.get());
        if (s) s->dump(fd, args, numArgs);
        return;
    }

  private:
    std::weak_ptr<StreamCommonInterface> mStream;
    ndk::SpAIBinder mStreamBinder;
@@ -694,6 +700,12 @@ class Streams {
        }
        return ndk::ScopedAStatus::ok();
    }
    void dump(int32_t portConfigId, int fd, const char** args, uint32_t numArgs) const {
        if (auto it = mStreams.find(portConfigId); it != mStreams.end()) {
            it->second.dump(fd, args, numArgs);
        }
        return;
    }

  private:
    // Maps port ids and port config ids to streams. Multimap because a port