====> project: frameworks/base diff --git a/services/core/java/com/android/server/hdmi/ActiveSourceAction.java b/services/core/java/com/android/server/hdmi/ActiveSourceAction.java index 179602737985..a551db1eb9e5 100644 --- a/services/core/java/com/android/server/hdmi/ActiveSourceAction.java +++ b/services/core/java/com/android/server/hdmi/ActiveSourceAction.java @@ -17,7 +17,8 @@ package com.android.server.hdmi; import android.hardware.hdmi.HdmiDeviceInfo; - +import android.util.Slog; +import android.os.SystemProperties; /** * Action that sends {@code } to make this device the currently active source. * @@ -25,6 +26,7 @@ import android.hardware.hdmi.HdmiDeviceInfo; * } messages. */ public class ActiveSourceAction extends HdmiCecFeatureAction { + private static final String TAG = "ActiveSourceAction"; private static final int STATE_STARTED = 1; private static final int STATE_FINISHED = 2; @@ -39,6 +41,13 @@ public class ActiveSourceAction extends HdmiCecFeatureAction { @Override boolean start() { mState = STATE_STARTED; + // Foxconn jerry test; + // Check system_reset mode; if yes , then do not send OTP + if("true".equals(SystemProperties.get("sys.skb.auto_reset"))) { + Slog.i(TAG, "in system reset mode"); + return false; + } + int logicalAddress = getSourceAddress(); int physicalAddress = getSourcePath(); diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDevicePlayback.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDevicePlayback.java index 2c355760a7ee..8b9fcc8326c8 100644 --- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDevicePlayback.java +++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDevicePlayback.java @@ -116,6 +116,13 @@ public class HdmiCecLocalDevicePlayback extends HdmiCecLocalDeviceSource { HdmiLogger.debug("No one touch play for quiescent boot."); } else { HdmiLogger.debug("Trigger one touch play after boot!"); + // Foxconn jerry test; + // Check system_reset mode; if yes , then do not send OTP + if("true".equals(SystemProperties.get("sys.skb.auto_reset"))) { + Slog.i(TAG, "in system reset mode"); + return; + } + mService.runOnServiceThreadDelayed(() -> { if (!mService.isTvAvailable()) { HdmiLogger.debug("No need to do boot for tv not available."); diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceSource.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceSource.java index c50314901610..f45a84d49c02 100644 --- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceSource.java +++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceSource.java @@ -33,6 +33,8 @@ import com.google.android.collect.Lists; import java.util.ArrayList; import java.util.List; +import android.os.SystemProperties; + /** * Represent a logical source device residing in Android system. */ @@ -124,6 +126,13 @@ abstract class HdmiCecLocalDeviceSource extends HdmiCecLocalDevice { HdmiLogger.debug("oneTouchPlay disabled!"); return; } + // Foxconn jerry test; + // Check system_reset mode; if yes , then do not send OTP + if("true".equals(SystemProperties.get("sys.skb.auto_reset"))) { + Slog.i(TAG, "in system reset mode"); + return; + } + List actions = getActions(OneTouchPlayAction.class); if (!actions.isEmpty()) { Slog.i(TAG, "oneTouchPlay already in progress"); @@ -237,6 +246,12 @@ abstract class HdmiCecLocalDeviceSource extends HdmiCecLocalDevice { @Constants.HandleMessageResult protected int handleSetStreamPath(HdmiCecMessage message) { assertRunOnServiceThread(); + // Foxconn jerry test; + // Check system_reset mode; if yes , then do not send OTP + if("true".equals(SystemProperties.get("sys.skb.auto_reset"))) { + Slog.i(TAG, "in system reset mode"); + return Constants.ABORT_REFUSED; + } int physicalAddress = HdmiUtils.twoBytesToInt(message.getParams()); // If current device is the target path, set to Active Source. // If the path is under the current device, should switch @@ -257,6 +272,12 @@ abstract class HdmiCecLocalDeviceSource extends HdmiCecLocalDevice { @Constants.HandleMessageResult protected int handleRoutingChange(HdmiCecMessage message) { assertRunOnServiceThread(); + // Foxconn jerry test; + // Check system_reset mode; if yes , then do not send OTP + if("true".equals(SystemProperties.get("sys.skb.auto_reset"))) { + Slog.i(TAG, "in system reset mode"); + return Constants.ABORT_REFUSED; + } int physicalAddress = HdmiUtils.twoBytesToInt(message.getParams(), 2); if (physicalAddress != mService.getPhysicalAddress() || !isActiveSource()) { // Invalidate the active source if routing is changed to other physical address or