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

Commit 66782d82 authored by Amy's avatar Amy Committed by Amy Zhang
Browse files

Only buffer the Active Source coming from the device under the current

device

Current logic buffers all the Active Source from any sources when the TV
input is not ready. But we do not need to buffer them when the Active
Source is connected to the TV or other devices but not the current
device itself. Those message will never be handled.

Test: manual
Bug: 135140934
Change-Id: Ib7a536c46bf323b7051aac141a9bbc8b6da84dfa
(cherry picked from commit 3782f5dbf09ff8ff10f82d408b4b40bb062b015c)
parent c21c005b
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -446,6 +446,14 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource {
        assertRunOnServiceThread();
        int logicalAddress = message.getSource();
        int physicalAddress = HdmiUtils.twoBytesToInt(message.getParams());
        if (HdmiUtils.getLocalPortFromPhysicalAddress(
            physicalAddress, mService.getPhysicalAddress())
                == HdmiUtils.TARGET_NOT_UNDER_LOCAL_DEVICE) {
            return super.handleActiveSource(message);
        }
        // If the new Active Source is under the current device, check if the device info and the TV
        // input is ready to switch to the new Active Source. If not ready, buffer the cec command
        // to handle later when the device is ready.
        HdmiDeviceInfo info = getCecDeviceInfo(logicalAddress);
        if (info == null) {
            HdmiLogger.debug("Device info %X not found; buffering the command", logicalAddress);
@@ -455,7 +463,7 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource {
            mDelayedMessageBuffer.add(message);
        } else {
            mDelayedMessageBuffer.removeActiveSource();
            super.handleActiveSource(message);
            return super.handleActiveSource(message);
        }
        return true;
    }