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

Commit 5ad57168 authored by Jinsuk Kim's avatar Jinsuk Kim
Browse files

Invoke callback for HdmiControlService.deviceSelect() for internal source

The call should be always successful if device to switch to is internal
TV source as setting it as the active source doesn't require communication
with other devices. Added the missing callback invocation.

Change-Id: I9968098316a955509f4de0e7af6f4407087ad4a2
parent 40075c7c
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -135,7 +135,10 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
    void deviceSelect(int targetAddress, IHdmiControlCallback callback) {
        assertRunOnServiceThread();
        if (targetAddress == Constants.ADDR_INTERNAL) {
            handleSelectInternalSource(callback);
            handleSelectInternalSource();
            // Switching to internal source is always successful even when CEC control is disabled.
            setActiveSource(targetAddress);
            invokeCallback(callback, HdmiControlManager.RESULT_SUCCESS);
            return;
        }
        if (!mService.isControlEnabled()) {
@@ -153,7 +156,7 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
    }

    @ServiceThreadOnly
    private void handleSelectInternalSource(IHdmiControlCallback callback) {
    private void handleSelectInternalSource() {
        assertRunOnServiceThread();
        // Seq #18
        if (mService.isControlEnabled() && getActiveSource() != mAddress) {