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

Skip to content
Commit 0ee2596c authored by Yan Han's avatar Yan Han
Browse files

When using AVB, update mute state in AudioService after updating volume

When using absolute volume behavior (AVB), we track the volume and mute
state of the AVR independently, as they are treated this way in the CEC
protocol. A device can be muted but still remember its previous, nonzero
volume level, or be unmuted but with zero volume level.

However, volume and mute are not treated independently by AudioService:
setting the volume of a stream to zero mutes it, and setting it to a
nonzero value unmutes it. Because the current logic doesn't take this
into account, the mute state of STREAM_MUSIC can get set to an incorrect
value as the result of volume changes.

To ensure that STREAM_MUSIC has the correct mute state, this CL makes
it so we always set mute state after setting the volume level.

Since setting mute state doesn't have the unwanted side-effects of
setting volume, we will also set mute instead of volume in order to
show volume UI on TVs.

Test: atest TvToAudioSystemArcTest TvToAudioSystemEarcTest
Bug: 315734798

Change-Id: If9d991a7d9a8d383fab88b731be9d2a1b65d426e
parent 8356a5c5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment