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

Skip to content
Commit 64e0b5a2 authored by Yan Han's avatar Yan Han
Browse files

Fix volume UI from setStreamVolume when using adjust-only AVB

When AudioService#setStreamVolume is called, it first sets its stream
volume to the requested volume, and then tells HdmiControlService to
execute the volume change on the System Audio device.

This is problematic when using adjust-only absolute volume behavior,
where the System Audio device does not support <Set Audio Volume Level>
and therefore HdmiControlService is unable to set the System Audio
device's volume to a percentage.

To fix this, this CL makes HdmiControlService query the System Audio
device's volume level after AudioService receives setStreamVolume
call. This makes it so that AudioService is updated with its actual
volume level, instead of persisting an incorrect volume level and
showing incorrect UI.

The better long-term solution would be to change the API for adopting
absolute volume behavior to allow AudioService to be "lazier" in
updating its volume when setStreamVolume is called. But the approach in
this CL simpler, and still a big improvement to the current behavior.

Bug: 328219479
Test: atest TvToAudioSystemEarcAvbTest TvToAudioSystemArcAvbTest

Change-Id: Ib8a9d8273adc4ae9cf6e725894395fa4bb6d824d
parent 2966eb20
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