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

Commit f154a120 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...

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

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3137381



Change-Id: Iecc21095e2bc91de06178cff85679d911e064f2e
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 17f41e3d 0e31c612
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