Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a78d019d authored by Hannah.Hsu's avatar Hannah.Hsu
Browse files

Fix TV didn't initiate ARC sometimes.

Root Cause:
1. Some AVRs would send <Terminate ARC> several times and
wait for TV's response with <Report ARC Terminated>.
TV would only send <Report ARC Terminated> in current flow,
thus AVR couldn't be re-initiated, even TV send <Request ARC
Initiation>.
2. System might not start to initiate ARC after several times
hot-plug.

Solution:
1. Send <Report ARC Terminated> everytime when setArcStatus(false).
2. Re-initiate ARC when ARC is plugged in.

Verified pass with  Denon AVR-X3600H.

Bug:  168087640
Change-Id: I8a5adf8b9d1e378dfc0984113c7db60b1630a46c
parent d2aa5c59
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1569,10 +1569,11 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
        // When the device is not unplugged but reawaken from standby, we check if the System
        // Audio Control Feature is enabled or not then decide if turning SAM on/off accordingly.
        if (getAvrDeviceInfo() != null && portId == getAvrDeviceInfo().getPortId()) {
            HdmiLogger.debug("Port ID:%d, 5v=%b", portId, connected);
            if (!connected) {
                setSystemAudioMode(false);
            } else if (mSystemAudioControlFeatureEnabled != mService.isSystemAudioActivated()){
                setSystemAudioMode(mSystemAudioControlFeatureEnabled);
            } else {
                onNewAvrAdded(getAvrDeviceInfo());
            }
        }

+3 −3
Original line number Diff line number Diff line
@@ -102,12 +102,12 @@ final class SetArcTransmissionStateAction extends HdmiCecFeatureAction {
    }

    private void setArcStatus(boolean enabled) {
        boolean wasEnabled = tv().setArcStatus(enabled);
        Slog.i(TAG, "Change arc status [old:" + wasEnabled + ", new:" + enabled + "]");
        tv().setArcStatus(enabled);
        Slog.i(TAG, "Change arc status to " + enabled);

        // If enabled before and set to "disabled" and send <Report Arc Terminated> to
        // av reciever.
        if (!enabled && wasEnabled) {
        if (!enabled) {
            sendCommand(HdmiCecMessageBuilder.buildReportArcTerminated(getSourceAddress(),
                    mAvrAddress));
        }