diff options
| author | 2019-01-31 16:42:16 -0800 | |
|---|---|---|
| committer | 2019-02-01 14:04:38 -0800 | |
| commit | 27ae403dc07a8c8f409a2e69b7b0a760eedb0ea9 (patch) | |
| tree | 7d7e0dd5ec5bd3eb15767e98a15807f3e590e5e3 | |
| parent | 4d1a60d70f1364249a61b226d681c5b0d5ecf9ac (diff) | |
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
| -rw-r--r-- | services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java index cac1a95454fa..03704aad59c2 100644 --- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java +++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java @@ -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; } |