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

Commit 0e50045c authored by Eric Laurent's avatar Eric Laurent Committed by Android (Google) Code Review
Browse files

Merge "fixup '[BUG] audio: misalignement of native/java AudioAttributes'" into tm-qpr-dev

parents 95d3d6bb 5a594729
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ public:
    VolumeCurves *getVolumeCurves() { return &mGroupVolumeCurves; }

    void addSupportedAttributes(const audio_attributes_t &attr);
    AttributesVector getSupportedAttributes() const { return mGroupVolumeCurves.getAttributes(); }
    AttributesVector getSupportedAttributes() const;

    void addSupportedStream(audio_stream_type_t stream);
    StreamTypeVector getStreamTypes() const { return mGroupVolumeCurves.getStreamTypes(); }
+11 −0
Original line number Diff line number Diff line
@@ -37,6 +37,17 @@ VolumeGroup::VolumeGroup(const std::string &name, int indexMin, int indexMax) :
{
}

// Used for introspection, e.g. JAVA
AttributesVector VolumeGroup::getSupportedAttributes() const
{
    AttributesVector supportedAttributes = {};
    for (auto &aa : mGroupVolumeCurves.getAttributes()) {
        aa.source = AUDIO_SOURCE_INVALID;
        supportedAttributes.push_back(aa);
    }
    return supportedAttributes;
}

void VolumeGroup::dump(String8 *dst, int spaces) const
{
    dst->appendFormat("\n%*s-%s (id: %d)\n", spaces, "", mName.c_str(), mId);