FileDocCategorySizeDatePackage
SystemAudioActionFromAvr.javaAPI DocAndroid 5.1 API2686Thu Mar 12 22:22:42 GMT 2015com.android.server.hdmi

SystemAudioActionFromAvr

public final class SystemAudioActionFromAvr extends SystemAudioAction
Feature action that handles System Audio initiated by AVR devices.

Fields Summary
Constructors Summary
SystemAudioActionFromAvr(HdmiCecLocalDevice source, int avrAddress, boolean targetStatus, android.hardware.hdmi.IHdmiControlCallback callback)
Constructor

param
source {@link HdmiCecLocalDevice} instance
param
avrAddress logical address of AVR device
param
targetStatus Whether to enable the system audio mode or not
param
callback callback interface to be notified when it's done
throw
IllegalArugmentException if device type of tvAddress and avrAddress is invalid

        super(source, avrAddress, targetStatus, callback);
        HdmiUtils.verifyAddressType(getSourceAddress(), HdmiDeviceInfo.DEVICE_TV);
    
Methods Summary
private voidhandleSystemAudioActionFromAvr()

        if (mTargetAudioStatus == tv().isSystemAudioActivated()) {
            finishWithCallback(HdmiControlManager.RESULT_SUCCESS);
            return;
        }
        if (tv().isProhibitMode()) {
            sendCommand(HdmiCecMessageBuilder.buildFeatureAbortCommand(
                    getSourceAddress(), mAvrLogicalAddress,
                    Constants.MESSAGE_SET_SYSTEM_AUDIO_MODE, Constants.ABORT_REFUSED));
            mTargetAudioStatus = false;
            sendSystemAudioModeRequest();
            return;
        }

        removeAction(SystemAudioAutoInitiationAction.class);

        if (mTargetAudioStatus) {
            setSystemAudioMode(true);
            startAudioStatusAction();
        } else {
            setSystemAudioMode(false);
            finishWithCallback(HdmiControlManager.RESULT_SUCCESS);
        }
    
booleanstart()

        removeSystemAudioActionInProgress();
        handleSystemAudioActionFromAvr();
        return true;