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

Commit ef3ea2ea authored by Hongguang Chen's avatar Hongguang Chen Committed by Android (Google) Code Review
Browse files

Merge "Enable SAM whenever CEC is disabled" into main

parents 8e6b83f6 e31cda45
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);
    }