Set SAM according to TV's settings

[Description]
Issue occur when
1) SystemAudioAutoInitiationAction timeout
2) receive <System Audio Mode Status>[OFF]
3) TV handles <System Audio Mode Status>[OFF]

In this case, TV will turn off SAM and ARC, which is unexpected

Bug: 156579158
Test: by OEM, AVR attached TV power off and on.

Change-Id: I2c68fe48210f132283f63d51646455039ff8b53a
This commit is contained in:
daren.liao
2020-05-13 17:04:13 +08:00
committed by Austin Shin
parent 817969762e
commit 8d3d4689a9

View File

@@ -1165,7 +1165,21 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
// Ignore this message.
return true;
}
setSystemAudioMode(HdmiUtils.parseCommandParamSystemAudioStatus(message));
boolean tvSystemAudioMode = isSystemAudioControlFeatureEnabled();
boolean avrSystemAudioMode = HdmiUtils.parseCommandParamSystemAudioStatus(message);
// Set System Audio Mode according to TV's settings.
// Handle <System Audio Mode Status> here only when
// SystemAudioAutoInitiationAction timeout
HdmiDeviceInfo avr = getAvrDeviceInfo();
if (avr == null) {
setSystemAudioMode(false);
} else if (avrSystemAudioMode != tvSystemAudioMode) {
addAndStartAction(new SystemAudioActionFromTv(this, avr.getLogicalAddress(),
tvSystemAudioMode, null));
} else {
setSystemAudioMode(tvSystemAudioMode);
}
return true;
}