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
Loading
Please register or sign in to comment