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

Commit 454fab52 authored by Jinsuk Kim's avatar Jinsuk Kim
Browse files

CEC: Discard key event to itself

Should discard keyevents if the target address is the device itself.

Bug: 19188660
Change-Id: Id47d79c996f60c9d90540f28c4b2509976d2f378
parent 26faa0be
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -431,11 +431,15 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
            return;
        }
        List<SendKeyAction> action = getActions(SendKeyAction.class);
        int logicalAddress = findKeyReceiverAddress();
        if (logicalAddress == mAddress) {
            Slog.w(TAG, "Discard key event to itself :" + keyCode + " pressed:" + isPressed);
            return;
        }
        if (!action.isEmpty()) {
            action.get(0).processKeyEvent(keyCode, isPressed);
        } else {
            if (isPressed) {
                int logicalAddress = findKeyReceiverAddress();
                if (logicalAddress != Constants.ADDR_INVALID) {
                    addAndStartAction(new SendKeyAction(this, logicalAddress, keyCode));
                    return;