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

Commit baa97045 authored by Amy's avatar Amy Committed by Amy Zhang
Browse files

Add a port id validation before handling the manual port select.

Test: manual
Change-Id: I3313a5fd4c09888d5f00e6feaa0e039bd84e6586
(cherry picked from commit de489cfe3ecb92e3889e88ec62e5cabfdf9d4d22)
parent 53b7e93c
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -970,7 +970,10 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource {
    @ServiceThreadOnly
    void doManualPortSwitching(int portId, IHdmiControlCallback callback) {
        assertRunOnServiceThread();
        // TODO: validate port ID
        if (!mService.isValidPortId(portId)) {
            invokeCallback(callback, HdmiControlManager.RESULT_TARGET_NOT_AVAILABLE);
            return;
        }
        if (portId == getLocalActivePort()) {
            invokeCallback(callback, HdmiControlManager.RESULT_SUCCESS);
            return;