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

Commit 27ae403d authored by Amy's avatar Amy
Browse files

Answer "on" to TV querying system audio mode status when the audio

system is still initiating it.

Note that System Audio Mode initiation from AVR side could take a while.
During the process, the internal sam status is false.

When TV queries the sam status, current framework responds with the status
at that moment. Which means it returns false when sam init is not done.

But since AVR is turning the feature on and it knows
that TV supports sam when receiving TV's query. AVR can answer with a
yes in this situation.

Test: manual
Bug: 123287727
Change-Id: I544d2a9af12b71c66cbc24327792993f621b2520
parent 4d1a60d7
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -458,9 +458,19 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource {
    @ServiceThreadOnly
    protected boolean handleGiveSystemAudioModeStatus(HdmiCecMessage message) {
        assertRunOnServiceThread();
        // If the audio system is initiating the system audio mode on and TV asks the sam status at
        // the same time, respond with true. Since we know TV supports sam in this situation.
        // If the query comes from STB, we should respond with the current sam status and the STB
        // should listen to the <Set System Audio Mode> broadcasting.
        boolean isSystemAudioModeOnOrTurningOn = isSystemAudioActivated();
        if (!isSystemAudioModeOnOrTurningOn
                && message.getSource() == Constants.ADDR_TV
                && hasAction(SystemAudioInitiationActionFromAvr.class)) {
            isSystemAudioModeOnOrTurningOn = true;
        }
        mService.sendCecCommand(
                HdmiCecMessageBuilder.buildReportSystemAudioMode(
                        mAddress, message.getSource(), mSystemAudioActivated));
                        mAddress, message.getSource(), isSystemAudioModeOnOrTurningOn));
        return true;
    }