Merge "CEC: Send <Give System Audio Mode> regardless of TV's setting." into lmp-mr1-dev

This commit is contained in:
Jungshik Jang
2014-11-10 00:54:30 +00:00
committed by Android (Google) Code Review
2 changed files with 10 additions and 15 deletions

View File

@@ -706,9 +706,7 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
@ServiceThreadOnly
void onNewAvrAdded(HdmiDeviceInfo avr) {
assertRunOnServiceThread();
if (getSystemAudioModeSetting()) {
addAndStartAction(new SystemAudioAutoInitiationAction(this, avr.getLogicalAddress()));
}
addAndStartAction(new SystemAudioAutoInitiationAction(this, avr.getLogicalAddress()));
if (isArcFeatureEnabled()) {
startArcAction(true);
}

View File

@@ -71,19 +71,16 @@ final class SystemAudioAutoInitiationAction extends HdmiCecFeatureAction {
}
private void handleSystemAudioModeStatusMessage() {
// If the last setting is system audio, turn on system audio whatever AVR status is.
if (tv().getSystemAudioModeSetting()) {
if (canChangeSystemAudio()) {
addAndStartAction(new SystemAudioActionFromTv(tv(), mAvrAddress, true, null));
}
} else {
// If the last setting is non-system audio, turn off system audio mode
// and update system audio status (volume or mute).
tv().setSystemAudioMode(false, true);
if (canChangeSystemAudio()) {
addAndStartAction(new SystemAudioStatusAction(tv(), mAvrAddress, null));
}
if (!canChangeSystemAudio()) {
HdmiLogger.debug("Cannot change system audio mode in auto initiation action.");
finish();
return;
}
boolean systemAudioModeSetting = tv().getSystemAudioModeSetting();
// Update AVR's system audio mode regardless of AVR's status.
addAndStartAction(new SystemAudioActionFromTv(tv(), mAvrAddress, systemAudioModeSetting,
null));
finish();
}