From 8e083ec0444e52cb203228bcf1c1cd34bcc4e70d Mon Sep 17 00:00:00 2001 From: Jinsuk Kim Date: Tue, 12 Aug 2014 18:10:21 +0900 Subject: CEC: Remove timeout from deviceSelect processing 20-second timeout set for incoming command after is moved out of HdmiControlService, to HDMI input service. Bug: 16967429 Change-Id: I5b50b0187e562b51e227a29e54824740ca37906e --- .../android/server/hdmi/DeviceSelectAction.java | 27 ++-------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/services/core/java/com/android/server/hdmi/DeviceSelectAction.java b/services/core/java/com/android/server/hdmi/DeviceSelectAction.java index ed37ead..d155e84 100644 --- a/services/core/java/com/android/server/hdmi/DeviceSelectAction.java +++ b/services/core/java/com/android/server/hdmi/DeviceSelectAction.java @@ -23,7 +23,6 @@ import android.hardware.hdmi.IHdmiControlCallback; import android.os.RemoteException; import android.util.Slog; -import com.android.server.hdmi.HdmiCecLocalDevice.ActiveSource; import com.android.server.hdmi.HdmiControlService.SendMessageCallback; /** @@ -42,9 +41,6 @@ final class DeviceSelectAction extends HdmiCecFeatureAction { // Time in milliseconds we wait for the device power status to turn to 'On'. private static final int TIMEOUT_POWER_ON_MS = 5 * 1000; - // Time in milliseconds we wait for . - private static final int TIMEOUT_ACTIVE_SOURCE_MS = 20 * 1000; - // The number of times we try to wake up the target device before we give up // and just send . private static final int LOOP_COUNTER_MAX = 20; @@ -62,11 +58,6 @@ final class DeviceSelectAction extends HdmiCecFeatureAction { // maximum 100 seconds (20 * 5) before we give up and just send . private static final int STATE_WAIT_FOR_DEVICE_POWER_ON = 3; - // State in which we wait for the in response to the command - // we have sent. We wait as much as TIMEOUT_ACTIVE_SOURCE_MS - // before we give up and mark the action as failure. - private static final int STATE_WAIT_FOR_ACTIVE_SOURCE = 4; - private final HdmiDeviceInfo mTarget; private final IHdmiControlCallback mCallback; private final HdmiCecMessage mGivePowerStatus; @@ -129,16 +120,6 @@ final class DeviceSelectAction extends HdmiCecFeatureAction { return handleReportPowerStatus(params[0]); } return false; - case STATE_WAIT_FOR_ACTIVE_SOURCE: - if (opcode == Constants.MESSAGE_ACTIVE_SOURCE) { - int physicalAddress = HdmiUtils.twoBytesToInt(params); - ActiveSourceHandler - .create((HdmiCecLocalDeviceTv) localDevice(), mCallback) - .process(ActiveSource.of(cmd.getSource(), physicalAddress)); - finish(); - return true; - } - return false; default: break; } @@ -189,8 +170,8 @@ final class DeviceSelectAction extends HdmiCecFeatureAction { private void sendSetStreamPath() { sendCommand(HdmiCecMessageBuilder.buildSetStreamPath( getSourceAddress(), mTarget.getPhysicalAddress())); - mState = STATE_WAIT_FOR_ACTIVE_SOURCE; - addTimer(mState, TIMEOUT_ACTIVE_SOURCE_MS); + invokeCallback(HdmiControlManager.RESULT_SUCCESS); + finish(); } @Override @@ -213,10 +194,6 @@ final class DeviceSelectAction extends HdmiCecFeatureAction { mPowerStatusCounter++; queryDevicePowerStatus(); break; - case STATE_WAIT_FOR_ACTIVE_SOURCE: - invokeCallback(HdmiControlManager.RESULT_TIMEOUT); - finish(); - break; } } -- cgit v1.1