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

Commit 867b4e0c authored by Jungshik Jang's avatar Jungshik Jang
Browse files

Set active port path to HdmiControlService

Set active port path to HdmiControlService so that the service
can handle proper event patch between cec and mhl devices.

Bug: 16215362
Change-Id: I2bd703916a422429b1029067fa3422e24de39274
parent 502d8b3b
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -631,6 +631,7 @@ abstract class HdmiCecLocalDevice {
        synchronized (mLock) {
            mActiveRoutingPath = path;
        }
        mService.setActivePortId(pathToPortId(path));
    }

    /**
@@ -649,11 +650,9 @@ abstract class HdmiCecLocalDevice {
     * @param portId the new active port id
     */
    void setActivePortId(int portId) {
        synchronized (mLock) {
        // We update active routing path instead, since we get the active port id from
        // the active routing path.
            mActiveRoutingPath = mService.portIdToPath(portId);
        }
        setActivePath(mService.portIdToPath(portId));
    }

    @ServiceThreadOnly
+9 −0
Original line number Diff line number Diff line
@@ -239,6 +239,9 @@ public final class HdmiControlService extends SystemService {
    @ServiceThreadOnly
    private boolean mWakeUpMessageReceived = false;

    @ServiceThreadOnly
    private int mActivePortId = Constants.INVALID_PORT_ID;

    public HdmiControlService(Context context) {
        super(context);
        mLocalDevices = HdmiUtils.asImmutableList(getContext().getResources().getIntArray(
@@ -1718,4 +1721,10 @@ public final class HdmiControlService extends SystemService {
            });
        }
    }

    @ServiceThreadOnly
    void setActivePortId(int portId) {
        assertRunOnServiceThread();
        mActivePortId = portId;
    }
}