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

Commit 0e31c612 authored by Winni Chang's avatar Winni Chang Committed by Automerger Merge Worker
Browse files

Merge "Call addCecDevice when device updates its physical address" into main am: 266fd322

parents ced37b39 266fd322
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -660,9 +660,13 @@ public class HdmiCecNetwork {
                    .setPortId(physicalAddressToPortId(physicalAddress))
                    .setDeviceType(type)
                    .build();
            if (deviceInfo.getPhysicalAddress() != physicalAddress) {
                addCecDevice(updatedDeviceInfo);
            } else {
                updateCecDevice(updatedDeviceInfo);
            }
        }
    }

    @ServiceThreadOnly
    private void handleReportPowerStatus(HdmiCecMessage message) {
+5 −4
Original line number Diff line number Diff line
@@ -396,7 +396,7 @@ public class HdmiCecNetworkTest {
    }

    @Test
    public void cecDevices_tracking_updatesPhysicalAddress() {
    public void cecDevices_tracking_updatesPhysicalAddress_add() {
        int logicalAddress = Constants.ADDR_PLAYBACK_1;
        int initialPhysicalAddress = 0x1000;
        int updatedPhysicalAddress = 0x2000;
@@ -415,11 +415,12 @@ public class HdmiCecNetworkTest {
        assertThat(cecDeviceInfo.getPhysicalAddress()).isEqualTo(updatedPhysicalAddress);
        assertThat(cecDeviceInfo.getDeviceType()).isEqualTo(type);

        // ADD for physical address first detected
        // UPDATE for updating device with new physical address
        // Handle case where PA is changed: Update CEC device information by calling
        // addCecDevice().
        assertThat(mDeviceEventListenerStatuses).containsExactly(
                HdmiControlManager.DEVICE_EVENT_ADD_DEVICE,
                HdmiControlManager.DEVICE_EVENT_UPDATE_DEVICE);
                HdmiControlManager.DEVICE_EVENT_REMOVE_DEVICE,
                HdmiControlManager.DEVICE_EVENT_ADD_DEVICE);
    }

    @Test