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

Commit a6f234e1 authored by Paul Colta's avatar Paul Colta
Browse files

HDMI: Fix possible IndexOutOfBoundsException in HdmiControlService

Test: atest com.android.server.hdmi
Bug: 367792511
Flag: EXEMPT bugfix
Change-Id: I28e559d873666b10b60e79d96cdeca1174a8f5f1
parent fddf3266
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1685,7 +1685,11 @@ public class HdmiControlService extends SystemService {
    private void sendCecCommandWithRetries(HdmiCecMessage command,
            @Nullable SendMessageCallback callback) {
        assertRunOnServiceThread();
        HdmiCecLocalDevice localDevice = getAllCecLocalDevices().get(0);
        List<HdmiCecLocalDevice> devices = getAllCecLocalDevices();
        if (devices.isEmpty()) {
            return;
        }
        HdmiCecLocalDevice localDevice = devices.get(0);
        if (localDevice != null) {
            sendCecCommandWithoutRetries(command, new SendMessageCallback() {
                @Override