Merge "docs: Updated Billing API documentation (for Project Nickel)." into mnc-io-docs am: 5ea88aad9d am: 1ee7930329 am: 29bcedc4b1
am: 9ac566bb93
* commit '9ac566bb935f5485dcabf8ac8d3ea55d3dd35b55':
CEC: Update system audio mode based on the current status of AVR
Change-Id: I6867d716d99c6306cd4548667ac55637aa2baf57
This commit is contained in:
@@ -826,9 +826,7 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
|
||||
@ServiceThreadOnly
|
||||
void onNewAvrAdded(HdmiDeviceInfo avr) {
|
||||
assertRunOnServiceThread();
|
||||
if (getSystemAudioModeSetting() && !isSystemAudioActivated()) {
|
||||
addAndStartAction(new SystemAudioAutoInitiationAction(this, avr.getLogicalAddress()));
|
||||
}
|
||||
addAndStartAction(new SystemAudioAutoInitiationAction(this, avr.getLogicalAddress()));
|
||||
if (isArcFeatureEnabled(avr.getPortId())
|
||||
&& !hasAction(SetArcTransmissionStateAction.class)) {
|
||||
startArcAction(true);
|
||||
@@ -1172,12 +1170,13 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
|
||||
if (getAvrDeviceInfo() == null) {
|
||||
// AVR may not have been discovered yet. Delay the message processing.
|
||||
mDelayedMessageBuffer.add(message);
|
||||
return true;
|
||||
} else {
|
||||
HdmiLogger.warning("Invalid <Set System Audio Mode> message:" + message);
|
||||
mService.maySendFeatureAbortCommand(message, Constants.ABORT_REFUSED);
|
||||
}
|
||||
HdmiLogger.warning("Invalid <Set System Audio Mode> message:" + message);
|
||||
mService.maySendFeatureAbortCommand(message, Constants.ABORT_REFUSED);
|
||||
return true;
|
||||
}
|
||||
removeAction(SystemAudioAutoInitiationAction.class);
|
||||
SystemAudioActionFromAvr action = new SystemAudioActionFromAvr(this,
|
||||
message.getSource(), HdmiUtils.parseCommandParamSystemAudioStatus(message), null);
|
||||
addAndStartAction(action);
|
||||
|
||||
@@ -64,13 +64,13 @@ final class SystemAudioAutoInitiationAction extends HdmiCecFeatureAction {
|
||||
}
|
||||
|
||||
if (cmd.getOpcode() == Constants.MESSAGE_SYSTEM_AUDIO_MODE_STATUS) {
|
||||
handleSystemAudioModeStatusMessage();
|
||||
handleSystemAudioModeStatusMessage(HdmiUtils.parseCommandParamSystemAudioStatus(cmd));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void handleSystemAudioModeStatusMessage() {
|
||||
private void handleSystemAudioModeStatusMessage(boolean isSystemAudioModeOn) {
|
||||
if (!canChangeSystemAudio()) {
|
||||
HdmiLogger.debug("Cannot change system audio mode in auto initiation action.");
|
||||
finish();
|
||||
@@ -78,9 +78,11 @@ final class SystemAudioAutoInitiationAction extends HdmiCecFeatureAction {
|
||||
}
|
||||
|
||||
boolean systemAudioModeSetting = tv().getSystemAudioModeSetting();
|
||||
// Update AVR's system audio mode regardless of AVR's status.
|
||||
addAndStartAction(new SystemAudioActionFromTv(tv(), mAvrAddress, systemAudioModeSetting,
|
||||
null));
|
||||
if (systemAudioModeSetting && !isSystemAudioModeOn) {
|
||||
addAndStartAction(new SystemAudioActionFromTv(tv(), mAvrAddress, systemAudioModeSetting, null));
|
||||
} else {
|
||||
tv().setSystemAudioMode(isSystemAudioModeOn, true);
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user