Methods Summary |
---|
private boolean | canChangeSystemAudio()
return !(tv().hasAction(SystemAudioActionFromTv.class)
|| tv().hasAction(SystemAudioActionFromAvr.class));
|
private void | handleSystemAudioModeStatusMessage()
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();
|
private void | handleSystemAudioModeStatusTimeout()
if (tv().getSystemAudioModeSetting()) {
if (canChangeSystemAudio()) {
addAndStartAction(new SystemAudioActionFromTv(tv(), mAvrAddress, true, null));
}
} else {
tv().setSystemAudioMode(false, true);
}
finish();
|
void | handleTimerEvent(int state)
if (mState != state) {
return;
}
switch (mState) {
case STATE_WAITING_FOR_SYSTEM_AUDIO_MODE_STATUS:
handleSystemAudioModeStatusTimeout();
break;
}
|
boolean | processCommand(HdmiCecMessage cmd)
if (mState != STATE_WAITING_FOR_SYSTEM_AUDIO_MODE_STATUS
|| mAvrAddress != cmd.getSource()) {
return false;
}
if (cmd.getOpcode() == Constants.MESSAGE_SYSTEM_AUDIO_MODE_STATUS) {
handleSystemAudioModeStatusMessage();
return true;
}
return false;
|
private void | sendGiveSystemAudioModeStatus()
sendCommand(HdmiCecMessageBuilder.buildGiveSystemAudioModeStatus(getSourceAddress(),
mAvrAddress), new SendMessageCallback() {
@Override
public void onSendCompleted(int error) {
if (error != Constants.SEND_RESULT_SUCCESS) {
tv().setSystemAudioMode(false, true);
finish();
}
}
});
|
boolean | start()
mState = STATE_WAITING_FOR_SYSTEM_AUDIO_MODE_STATUS;
addTimer(mState, HdmiConfig.TIMEOUT_MS);
sendGiveSystemAudioModeStatus();
return true;
|