From 455f09d818d23d918d0146c91f977774cbfb0657 Mon Sep 17 00:00:00 2001 From: Donghyun Cho Date: Tue, 10 May 2016 20:06:52 +0900 Subject: [PATCH] CEC: Handle from AVR properly To avoid timing issues, handling of was delayed until corresponding tv input becomes ready. However, AVR is not considered as a tv input, so delayed will not be processed. This change makes from AVR handled immediately rather than buffered. Bug: 25630805 Change-Id: Iae8e86a84b5a9e5a2e62e457aaf93da67f145fac --- .../com/android/server/hdmi/HdmiCecLocalDeviceTv.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java index e63a143c8d92c..c89055c673042 100644 --- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java +++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java @@ -499,13 +499,14 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice { HdmiLogger.debug("Device info %X not found; buffering the command", logicalAddress); mDelayedMessageBuffer.add(message); } - } else if (!isInputReady(info.getId())) { - HdmiLogger.debug("Input not ready for device: %X; buffering the command", info.getId()); - mDelayedMessageBuffer.add(message); - } else { + } else if (isInputReady(info.getId()) + || info.getDeviceType() == HdmiDeviceInfo.DEVICE_AUDIO_SYSTEM) { updateDevicePowerStatus(logicalAddress, HdmiControlManager.POWER_STATUS_ON); ActiveSource activeSource = ActiveSource.of(logicalAddress, physicalAddress); ActiveSourceHandler.create(this, null).process(activeSource, info.getDeviceType()); + } else { + HdmiLogger.debug("Input not ready for device: %X; buffering the command", info.getId()); + mDelayedMessageBuffer.add(message); } return true; }