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

Commit 140fdf2b authored by Sherry Huang's avatar Sherry Huang
Browse files

HDMI-CEC: Disable AVB when system audio device is TV

Currently there is no GTV supporting outgoing <Report Audio Status>.
Based on CEC specification 2.0, <Give Audio Status> and <Report Audio Status>
for both directions are enforced only for amplifier, so the case under
general TV supporting it might be rare. Given some non-GTV TVs not
responding <Feature Abort> causing volume issues, we should disable it
until outgoing <Report Audio Status> is enforced on TV.

Bug: b/406050353
Test: atest com.android.server.hdmi
Flag: EXEMPT bugfix
Change-Id: Id7635d5950b11a5d15b98cacb99b79e195a93120
parent 31af15fb
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -4734,16 +4734,20 @@ public class HdmiControlService extends SystemService {
            return;
        }

        // Determine if the selected System Audio output is a TV.
        // Unlike amplifiers, TVs are not mandated to send <Report Audio Status> even in HDMI 2.0.
        // To avoid these problems, we only allow absolute volume when an amplifier is being used
        // as the system audio device.
        if (mAvbDisabled && systemAudioDeviceInfo.getDeviceType() == HdmiDeviceInfo.DEVICE_TV) {
            switchToFullVolumeBehavior();
            return;
        }

        // Condition 5: The System Audio device supports <Set Audio Volume Level>
        switch (systemAudioDeviceInfo.getDeviceFeatures().getSetAudioVolumeLevelSupport()) {
            case DeviceFeatures.FEATURE_SUPPORTED:
                if (currentVolumeBehavior
                        != AudioDeviceVolumeManager.DEVICE_VOLUME_BEHAVIOR_ABSOLUTE) {
                    // Switch to full volume behavior for playback devices due to b/406050353
                    if (mAvbDisabled && isPlaybackDevice()) {
                        switchToFullVolumeBehavior();
                        return;
                    }
                    // Keep using AVB for other cases
                    // Start an action that will call enableAbsoluteVolumeBehavior
                    // once the System Audio device sends <Report Audio Status>