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

Commit 777abd72 authored by Amy's avatar Amy Committed by Shubang Lu
Browse files

Enable sendStandby for device not supporting CEC multi device type.

ag/4986713

Test: local test
Bug: 114302332
Change-Id: I73b958daf40d0e86174e713053c539c666fe1672
parent acc1dab9
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -332,16 +332,6 @@ final class HdmiCecLocalDevicePlayback extends HdmiCecLocalDeviceSource {
        return Constants.ADDR_TV;
    }

    @Override
    @ServiceThreadOnly
    protected void sendStandby(int deviceId) {
        assertRunOnServiceThread();

        // Playback device can send <Standby> to TV only. Ignore the parameter.
        int targetAddress = Constants.ADDR_TV;
        mService.sendCecCommand(HdmiCecMessageBuilder.buildStandby(mAddress, targetAddress));
    }

    @Override
    @ServiceThreadOnly
    protected void disableDevice(boolean initiatedByCec, PendingActionClearedCallback callback) {
+10 −0
Original line number Diff line number Diff line
@@ -50,6 +50,16 @@ abstract class HdmiCecLocalDeviceSource extends HdmiCecLocalDevice {
        }
    }

    @Override
    @ServiceThreadOnly
    protected void sendStandby(int deviceId) {
        assertRunOnServiceThread();

        // Send standby to TV only for now
        int targetAddress = Constants.ADDR_TV;
        mService.sendCecCommand(HdmiCecMessageBuilder.buildStandby(mAddress, targetAddress));
    }

    @ServiceThreadOnly
    void oneTouchPlay(IHdmiControlCallback callback) {
        assertRunOnServiceThread();
+3 −0
Original line number Diff line number Diff line
@@ -1662,6 +1662,9 @@ public class HdmiControlService extends SystemService {
                        return;
                    }
                    HdmiCecLocalDevice device = mCecController.getLocalDevice(deviceType);
                    if (device == null) {
                        device = audioSystem();
                    }
                    if (device == null) {
                        Slog.w(TAG, "Local device not available");
                        return;