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

Commit 266fd322 authored by Winni Chang's avatar Winni Chang Committed by Gerrit Code Review
Browse files

Merge "Call addCecDevice when device updates its physical address" into main

parents 9e58ba81 a8d2a5ad
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -655,9 +655,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