From 454fab52195f86d08d0b7626ed170af113e44695 Mon Sep 17 00:00:00 2001 From: Jinsuk Kim Date: Thu, 29 Jan 2015 16:38:36 +0900 Subject: CEC: Discard key event to itself Should discard keyevents if the target address is the device itself. Bug: 19188660 Change-Id: Id47d79c996f60c9d90540f28c4b2509976d2f378 --- .../core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'services/core/java') diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java index 43ef457..418d618 100644 --- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java +++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java @@ -431,11 +431,15 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice { return; } List 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; -- cgit v1.1