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

Commit 89a518f6 authored by Paul Colta's avatar Paul Colta Committed by Android (Google) Code Review
Browse files

Merge "cec: request current active source first when boot up [1/1]" into main

parents a7972e8f 9f396259
Loading
Loading
Loading
Loading
+5 −12
Original line number Diff line number Diff line
@@ -212,11 +212,11 @@ public class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
                    HdmiConfig.TIMEOUT_MS);
        }

        launchRoutingControl(reason != HdmiControlService.INITIATED_BY_ENABLE_CEC &&
                reason != HdmiControlService.INITIATED_BY_BOOT_UP);
        resetSelectRequestBuffer();
        launchDeviceDiscovery();
        startQueuedActions();
        final boolean routingForBootup = reason != HdmiControlService.INITIATED_BY_ENABLE_CEC
                && reason != HdmiControlService.INITIATED_BY_BOOT_UP;
        List<HdmiCecMessage> bufferedActiveSource = mDelayedMessageBuffer
                .getBufferedMessagesWithOpcode(Constants.MESSAGE_ACTIVE_SOURCE);
        if (bufferedActiveSource.isEmpty()) {
@@ -227,14 +227,8 @@ public class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
            addAndStartAction(new RequestActiveSourceAction(this, new IHdmiControlCallback.Stub() {
                @Override
                public void onComplete(int result) {
                    if (!mService.getLocalActiveSource().isValid()
                            && result != HdmiControlManager.RESULT_SUCCESS) {
                        mService.sendCecCommand(HdmiCecMessageBuilder.buildActiveSource(
                                getDeviceInfo().getLogicalAddress(),
                                getDeviceInfo().getPhysicalAddress()));
                        updateActiveSource(getDeviceInfo().getLogicalAddress(),
                                getDeviceInfo().getPhysicalAddress(),
                                "RequestActiveSourceAction#finishWithCallback()");
                    if (result != HdmiControlManager.RESULT_SUCCESS) {
                        launchRoutingControl(routingForBootup);
                    }
                }
            }));
@@ -1384,8 +1378,7 @@ public class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
        } else {
            int activePath = mService.getPhysicalAddress();
            setActivePath(activePath);
            if (!routingForBootup
                    && !mDelayedMessageBuffer.isBuffered(Constants.MESSAGE_ACTIVE_SOURCE)) {
            if (!mDelayedMessageBuffer.isBuffered(Constants.MESSAGE_ACTIVE_SOURCE)) {
                mService.sendCecCommand(
                        HdmiCecMessageBuilder.buildActiveSource(
                                getDeviceInfo().getLogicalAddress(), activePath));