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

Commit 9320aa84 authored by Amy Zhang's avatar Amy Zhang Committed by Android (Google) Code Review
Browse files

Merge "Playback device should broadcast Inactive Source when it does not have...

Merge "Playback device should broadcast Inactive Source when it does not have video to broadcast any more"
parents aedde3aa c556aa36
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -163,10 +163,17 @@ public class HdmiCecLocalDevicePlayback extends HdmiCecLocalDeviceSource {
    @ServiceThreadOnly
    protected void onStandby(boolean initiatedByCec, int standbyAction) {
        assertRunOnServiceThread();
        if (!mService.isControlEnabled()) {
            return;
        }
        if (mIsActiveSource) {
            mService.sendCecCommand(HdmiCecMessageBuilder.buildInactiveSource(
                mAddress, mService.getPhysicalAddress()));
        }
        // Invalidate the internal active source record when goes to standby
        // This set will also update mIsActiveSource
        mService.setActiveSource(Constants.ADDR_INVALID, Constants.INVALID_PHYSICAL_ADDRESS);
        if (!mService.isControlEnabled() || initiatedByCec || !mAutoTvOff) {
        if (initiatedByCec || !mAutoTvOff) {
            return;
        }
        switch (standbyAction) {
@@ -349,11 +356,6 @@ public class HdmiCecLocalDevicePlayback extends HdmiCecLocalDeviceSource {
        super.disableDevice(initiatedByCec, callback);

        assertRunOnServiceThread();
        if (!initiatedByCec && mIsActiveSource && mService.isControlEnabled()) {
            mService.sendCecCommand(HdmiCecMessageBuilder.buildInactiveSource(
                    mAddress, mService.getPhysicalAddress()));
        }
        setIsActiveSource(false);
        checkIfPendingActionsCleared();
    }