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

Commit 63f653a0 authored by Marvin Ramin's avatar Marvin Ramin
Browse files

Fix unit test failure

Fix failing unit test: HdmiControlServiceBinderAPITest#oneTouchPlay_addressNotAllocated

Test fails as no logical address is allocated, causing a NPE in
HdmiCecLocalDeviceSource#isActiveSource.

Bug: 171956637
Test: atest com.android.server.hdmi
Change-Id: I75f4bb96b2bfae3f85d2c6a3eca8923b88363eb7
parent d03da613
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -246,6 +246,10 @@ abstract class HdmiCecLocalDeviceSource extends HdmiCecLocalDevice {
    // Indicates if current device is the active source or not
    @ServiceThreadOnly
    protected boolean isActiveSource() {
        if (getDeviceInfo() == null) {
            return false;
        }

        return getActiveSource().equals(getDeviceInfo().getLogicalAddress(),
                getDeviceInfo().getPhysicalAddress());
    }