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

Commit 6102bac7 authored by Jinsuk Kim's avatar Jinsuk Kim
Browse files

CEC: Update CEC device info properly

CEC device information cannot be updated/notified properly if
the device was plugged to other port. This change makes
sure the updated information is reflected by device event
callback listeners.

Bug: 18513567
Change-Id: I62bbb741d3f89e225a50f86e315da014832d8118
parent c5c93edd
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1324,12 +1324,16 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
    @ServiceThreadOnly
    final void addCecDevice(HdmiDeviceInfo info) {
        assertRunOnServiceThread();
        addDeviceInfo(info);
        HdmiDeviceInfo old = addDeviceInfo(info);
        if (info.getLogicalAddress() == mAddress) {
            // The addition of TV device itself should not be notified.
            return;
        }
        if (old == null) {
            invokeDeviceEventListener(info, HdmiControlManager.DEVICE_EVENT_ADD_DEVICE);
        } else if (!old.equals(info)) {
            invokeDeviceEventListener(info, HdmiControlManager.DEVICE_EVENT_UPDATE_DEVICE);
        }
    }

    /**