diff options
author | Jinsuk Kim <jinsukkim@google.com> | 2015-01-29 16:38:36 +0900 |
---|---|---|
committer | Jinsuk Kim <jinsukkim@google.com> | 2015-01-30 07:28:10 +0900 |
commit | 454fab52195f86d08d0b7626ed170af113e44695 (patch) | |
tree | 407a375286f5a60cb8c8b576aeb3c12327af74ea /services | |
parent | 26faa0be670484b3f32b9e4b07533c3fbef540f5 (diff) | |
download | frameworks_base-454fab52195f86d08d0b7626ed170af113e44695.zip frameworks_base-454fab52195f86d08d0b7626ed170af113e44695.tar.gz frameworks_base-454fab52195f86d08d0b7626ed170af113e44695.tar.bz2 |
CEC: Discard key event to itself
Should discard keyevents if the target address is the device itself.
Bug: 19188660
Change-Id: Id47d79c996f60c9d90540f28c4b2509976d2f378
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java | 6 |
1 files changed, 5 insertions, 1 deletions
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<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; |