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

Commit 9e1533cd authored by François Gaffie's avatar François Gaffie Committed by Eric Laurent
Browse files

audiopolicy: audioflinger: manage stream patch volume



AudioPolicy used to hide activity of stream patch to prevent changing
the volume.
This CL replaces the filtering of the stream patch activity on the policy
by a full volume range within audio flinger.
It updates also product strategies example for automotive to add associated
strategy and full range volume.

Bug: 130284799
Test: make

Signed-off-by: default avatarFrançois Gaffie <francois.gaffie@renault.com>
Change-Id: I6e77dc2cbed0289f0a1341f7597b1c25abee5f7d
parent 4b8d5ce5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1238,8 +1238,8 @@ status_t AudioFlinger::setStreamVolume(audio_stream_type_t stream, float value,
    if (output == AUDIO_IO_HANDLE_NONE) {
        return BAD_VALUE;
    }
    ALOG_ASSERT(stream != AUDIO_STREAM_PATCH || value == 1.0,
        "attempt to change AUDIO_STREAM_PATCH volume");
    LOG_ALWAYS_FATAL_IF(stream == AUDIO_STREAM_PATCH && value != 1.0f,
                        "AUDIO_STREAM_PATCH must have full scale volume");

    AutoMutex lock(mLock);
    VolumeInterface *volumeInterface = getVolumeInterface_l(output);
+0 −1
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@

namespace android {


/**
 * VolumeSource is the discriminent for volume management on an output.
 * It used to be the stream type by legacy, it may be host volume group or a volume curves if
+15 −0
Original line number Diff line number Diff line
@@ -166,5 +166,20 @@ limitations under the License.
            <Attributes> <Flags value="AUDIO_FLAG_BEACON"/> </Attributes>
        </AttributesGroup>
    </ProductStrategy>

    <!-- Routing Strategy rerouting may be removed as following media??? -->
    <ProductStrategy name="rerouting">
        <AttributesGroup streamType="AUDIO_STREAM_REROUTING" volumeGroup="rerouting">
            <Attributes></Attributes>
        </AttributesGroup>
    </ProductStrategy>

    <!-- Patch stream needs full scale volume, define it otherwise switch to default... -->
    <ProductStrategy name="patch">
        <AttributesGroup streamType="AUDIO_STREAM_PATCH" volumeGroup="patch">
            <Attributes></Attributes>
        </AttributesGroup>
    </ProductStrategy>

</ProductStrategies>
+21 −0
Original line number Diff line number Diff line
@@ -188,5 +188,26 @@
            <point>100,0</point>
        </volume>
    </volumeGroup>

    <volumeGroup>
        <name>rerouting</name>
        <indexMin>0</indexMin>
        <indexMax>1</indexMax>
        <volume deviceCategory="DEVICE_CATEGORY_HEADSET">
            <point>0,0</point>
            <point>100,0</point>
        </volume>
    </volumeGroup>

    <volumeGroup>
        <name>patch</name>
        <indexMin>0</indexMin>
        <indexMax>1</indexMax>
        <volume deviceCategory="DEVICE_CATEGORY_HEADSET">
            <point>0,0</point>
            <point>100,0</point>
        </volume>
    </volumeGroup>

</volumeGroups>
+14 −0
Original line number Diff line number Diff line
@@ -166,5 +166,19 @@ limitations under the License.
            <Attributes> <Flags value="AUDIO_FLAG_BEACON"/> </Attributes>
        </AttributesGroup>
    </ProductStrategy>

    <!-- Routing Strategy rerouting may be removed as following media??? -->
    <ProductStrategy name="rerouting">
        <AttributesGroup streamType="AUDIO_STREAM_REROUTING" volumeGroup="rerouting">
            <Attributes></Attributes>
        </AttributesGroup>
    </ProductStrategy>

    <!-- Patch stream needs full scale volume, define it otherwise switch to default... -->
    <ProductStrategy name="patch">
        <AttributesGroup streamType="AUDIO_STREAM_PATCH" volumeGroup="patch">
            <Attributes></Attributes>
        </AttributesGroup>
    </ProductStrategy>
</ProductStrategies>
Loading