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

Commit 54662165 authored by Jungshik Jang's avatar Jungshik Jang Committed by Android (Google) Code Review
Browse files

Merge "Set active port path to HdmiControlService" into lmp-dev

parents ff2efd52 867b4e0c
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;
    }
}