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

Commit f0f7f1b3 authored by Yuncheol Heo's avatar Yuncheol Heo Committed by Android (Google) Code Review
Browse files

Merge "Fix the hotplug behaviors in TV." into lmp-mr1-dev

parents 6333c7e0 b8d62e70
Loading
Loading
Loading
Loading
+11 −13
Original line number Diff line number Diff line
@@ -724,12 +724,9 @@ public final class HdmiControlService extends SystemService {
    void onHotplug(int portId, boolean connected) {
        assertRunOnServiceThread();

        if (connected && !isTvDevice()) {
            ArrayList<HdmiCecLocalDevice> localDevices = new ArrayList<>();
            for (int type : mLocalDevices) {
            if (type == HdmiDeviceInfo.DEVICE_TV) {
                // Skip the reallocation of the logical address on TV.
                continue;
            }
                HdmiCecLocalDevice localDevice = mCecController.getLocalDevice(type);
                if (localDevice == null) {
                    localDevice = HdmiCecLocalDevice.create(this, type);
@@ -738,6 +735,7 @@ public final class HdmiControlService extends SystemService {
                localDevices.add(localDevice);
            }
            allocateLogicalAddress(localDevices, INITIATED_BY_HOTPLUG);
        }

        for (HdmiCecLocalDevice device : mCecController.getLocalDeviceList()) {
            device.onHotplug(portId, connected);
@@ -1691,7 +1689,7 @@ public final class HdmiControlService extends SystemService {
    }

    boolean isTvDevice() {
        return tv() != null;
        return mLocalDevices.contains(HdmiDeviceInfo.DEVICE_TV);
    }

    private HdmiCecLocalDevicePlayback playback() {