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

Commit f9fa6175 authored by Amy's avatar Amy Committed by shubang
Browse files

Modify doManualPortSwitching logic in Audio System

ag/5248824

1. use pathToPort to get port id from physical address based on the map
maintained by cec controler

2. update routingPort.

Test: local tested
Bug: 112478040
Change-Id: I3ab163902d93c933f6139c18be2ec1e9dd060c10
parent 17ee20fc
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -494,19 +494,20 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource {
            invokeCallback(callback, HdmiControlManager.RESULT_SUCCESS);
            return;
        }
        getActiveSource().invalidate();
        if (!mService.isControlEnabled()) {
            setRoutingPort(portId);
            setLocalActivePort(portId);
            invokeCallback(callback, HdmiControlManager.RESULT_INCORRECT_MODE);
            return;
        }
        int oldPath = getLocalActivePort() != Constants.CEC_SWITCH_HOME
                ? getActivePathOnSwitchFromActivePortId(getLocalActivePort())
        int oldPath = getRoutingPort() != Constants.CEC_SWITCH_HOME
                ? mService.portIdToPath(getRoutingPort())
                : getDeviceInfo().getPhysicalAddress();
        int newPath = getActivePathOnSwitchFromActivePortId(portId);
        int newPath = mService.portIdToPath(portId);
        if (oldPath == newPath) {
            return;
        }
        setRoutingPort(portId);
        setLocalActivePort(portId);
        HdmiCecMessage routingChange =
                HdmiCecMessageBuilder.buildRoutingChange(mAddress, oldPath, newPath);