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

Commit 9fa4dc0f authored by eric_kuang.rs's avatar eric_kuang.rs Committed by Alison Chang
Browse files

Update local device info

Local device info should add at allocated, don't need wait cec device discovery action done.
If we wait it, local device info may not add to cec device info list.
It will cause deviceSelect(0) not execute, active source TV will be ignore,
and cect_IgnoreBroadcastedFromSameSource test fail.

Change-Id: Ia2c0141da00a823fbffe898babfdd3ed27249754
Test: run cts -m CtsHdmiCecHostTestCases -t
      android.hdmicec.cts.common.HdmiCecInvalidMessagesTest#cect_IgnoreBroadcastedFromSameSource
Bug: 258988939
parent e13fe5cc
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -682,7 +682,6 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
    @ServiceThreadOnly
    private void launchDeviceDiscovery() {
        assertRunOnServiceThread();
        clearDeviceInfoList();
        DeviceDiscoveryAction action = new DeviceDiscoveryAction(this,
                new DeviceDiscoveryCallback() {
                    @Override
@@ -691,13 +690,6 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
                            mService.getHdmiCecNetwork().addCecDevice(info);
                        }

                        // Since we removed all devices when it starts and
                        // device discovery action does not poll local devices,
                        // we should put device info of local device manually here
                        for (HdmiCecLocalDevice device : mService.getAllCecLocalDevices()) {
                            mService.getHdmiCecNetwork().addCecDevice(device.getDeviceInfo());
                        }

                        mSelectRequestBuffer.process();
                        resetSelectRequestBuffer();

+2 −0
Original line number Diff line number Diff line
@@ -1267,6 +1267,7 @@ public class HdmiControlService extends SystemService {
        // It's now safe to flush existing local devices from mCecController since they were
        // already moved to 'localDevices'.
        clearCecLocalDevices();
        mHdmiCecNetwork.clearDeviceList();
        allocateLogicalAddress(localDevices, initiatedBy);
    }

@@ -1303,6 +1304,7 @@ public class HdmiControlService extends SystemService {
                                        HdmiControlManager.POWER_STATUS_ON, getCecVersion());
                                localDevice.setDeviceInfo(deviceInfo);
                                mHdmiCecNetwork.addLocalDevice(deviceType, localDevice);
                                mHdmiCecNetwork.addCecDevice(localDevice.getDeviceInfo());
                                mCecController.addLogicalAddress(logicalAddress);
                                allocatedDevices.add(localDevice);
                            }