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

Commit e31cda45 authored by Winni Chang's avatar Winni Chang
Browse files

Enable SAM whenever CEC is disabled

To ensure consistent audio output, it is imperative to enable SAM whenever CEC is disabled. Failure to do so may result in the absence of sound when CEC is disabled and eARC is enabled due to SAM being in the off state.

Bug: 286504656
Test: atest
Change-Id: Ia2ea3d65dfe0fd29f903215d38818961d8e25c21
parent 5c733030
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -4951,6 +4951,11 @@ public class HdmiControlService extends SystemService {
        AudioDeviceAttributes attributes = new AudioDeviceAttributes(
                AudioDeviceAttributes.ROLE_OUTPUT, AudioDeviceInfo.TYPE_HDMI_EARC, "", "",
                new ArrayList<AudioProfile>(), audioDescriptors);
        // Set SAM to ON whenever CEC is disabled. Failure to do so may result in the absence
        // of sound when CEC is disabled and eARC is enabled due to SAM being in the off state.
        if (!isCecControlEnabled()) {
            setSystemAudioActivated(true);
        }
        getAudioManager().setWiredDeviceConnectionState(attributes, enabled ? 1 : 0);
    }