From 087839755d311b09f40a1b9db1d09c9c8bdf9872 Mon Sep 17 00:00:00 2001 From: Jinsuk Kim Date: Thu, 16 Apr 2015 07:46:18 +0900 Subject: CEC: Do not terminate ARC on send error busy Silently ignores the transmission error busy/failure for the command to keep the ARC on. Termination is done only for the explicit error (NAK). Bug: 20267416 Change-Id: I649d6494855b2d6aa0cecc8fd76d36001c0edb68 --- .../server/hdmi/SetArcTransmissionStateAction.java | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'services/core/java') diff --git a/services/core/java/com/android/server/hdmi/SetArcTransmissionStateAction.java b/services/core/java/com/android/server/hdmi/SetArcTransmissionStateAction.java index d200d35..9b4950b 100644 --- a/services/core/java/com/android/server/hdmi/SetArcTransmissionStateAction.java +++ b/services/core/java/com/android/server/hdmi/SetArcTransmissionStateAction.java @@ -54,7 +54,7 @@ final class SetArcTransmissionStateAction extends HdmiCecFeatureAction { boolean start() { // Seq #37. if (mEnabled) { - // Enable ARC status immediately after sending . + // Enable ARC status immediately before sending . // If AVR responds with , disable ARC status again. // This is different from spec that says that turns ARC status to // "Enabled" if is acknowledged and no @@ -80,12 +80,21 @@ final class SetArcTransmissionStateAction extends HdmiCecFeatureAction { sendCommand(command, new HdmiControlService.SendMessageCallback() { @Override public void onSendCompleted(int error) { - if (error != Constants.SEND_RESULT_SUCCESS) { - // If fails to send , disable ARC and - // send directly. - setArcStatus(false); - HdmiLogger.debug("Failed to send ."); - finish(); + switch (error) { + case Constants.SEND_RESULT_SUCCESS: + case Constants.SEND_RESULT_BUSY: + case Constants.SEND_RESULT_FAILURE: + // The result of the command transmission, unless it is an obvious + // failure indicated by the target device (or lack thereof), should + // not affect the ARC status. Ignores it silently. + break; + case Constants.SEND_RESULT_NAK: + // If is negatively ack'ed, disable ARC and + // send directly. + setArcStatus(false); + HdmiLogger.debug("Failed to send ."); + finish(); + break; } } }); -- cgit v1.1