Loading services/core/java/com/android/server/hdmi/RequestActiveSourceAction.java +6 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.server.hdmi; import android.hardware.hdmi.HdmiControlManager; import android.hardware.hdmi.IHdmiControlCallback; import android.util.Slog; import com.android.internal.annotations.VisibleForTesting; /** * Feature action that sends <Request Active Source> message and waits for <Active Source> on TV Loading @@ -39,6 +40,10 @@ public class RequestActiveSourceAction extends HdmiCecFeatureAction { // Number of retries <Request Active Source> is sent if no device answers this message. private static final int MAX_SEND_RETRY_COUNT = 1; // Timeout to wait for the LauncherX API call to be completed. @VisibleForTesting protected static final int TIMEOUT_WAIT_FOR_LAUNCHERX_API_CALL_MS = 10000; private int mSendRetryCount = 0; Loading @@ -55,7 +60,7 @@ public class RequestActiveSourceAction extends HdmiCecFeatureAction { // We wait for default timeout to allow the message triggered by the LauncherX API call to // be sent by the TV and another default timeout in case the message has to be answered // (e.g. TV sent a <Set Stream Path> or <Routing Change>). addTimer(mState, HdmiConfig.TIMEOUT_MS * 2); addTimer(mState, TIMEOUT_WAIT_FOR_LAUNCHERX_API_CALL_MS); return true; } Loading services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTvTest.java +6 −5 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import static com.android.server.hdmi.HdmiControlService.INITIATED_BY_ENABLE_CEC import static com.android.server.hdmi.HdmiControlService.INITIATED_BY_WAKE_UP_MESSAGE; import static com.android.server.hdmi.HdmiControlService.STANDBY_SCREEN_OFF; import static com.android.server.hdmi.HdmiControlService.WAKE_UP_SCREEN_ON; import static com.android.server.hdmi.RequestActiveSourceAction.TIMEOUT_WAIT_FOR_LAUNCHERX_API_CALL_MS; import static com.google.common.truth.Truth.assertThat; Loading Loading @@ -1792,7 +1793,7 @@ public class HdmiCecLocalDeviceTvTest { mTestLooper.dispatchAll(); // Skip the LauncherX API timeout. mTestLooper.moveTimeForward(HdmiConfig.TIMEOUT_MS * 2); mTestLooper.moveTimeForward(TIMEOUT_WAIT_FOR_LAUNCHERX_API_CALL_MS); mTestLooper.dispatchAll(); assertThat(mNativeWrapper.getResultMessages()).contains(requestActiveSource); Loading Loading @@ -1825,7 +1826,7 @@ public class HdmiCecLocalDeviceTvTest { mTestLooper.dispatchAll(); // Skip the LauncherX API timeout. mTestLooper.moveTimeForward(HdmiConfig.TIMEOUT_MS * 2); mTestLooper.moveTimeForward(TIMEOUT_WAIT_FOR_LAUNCHERX_API_CALL_MS); mTestLooper.dispatchAll(); assertThat(mNativeWrapper.getResultMessages()).contains(requestActiveSource); Loading Loading @@ -1861,7 +1862,7 @@ public class HdmiCecLocalDeviceTvTest { mTestLooper.dispatchAll(); // Skip the LauncherX API timeout. mTestLooper.moveTimeForward(HdmiConfig.TIMEOUT_MS * 2); mTestLooper.moveTimeForward(TIMEOUT_WAIT_FOR_LAUNCHERX_API_CALL_MS); mTestLooper.dispatchAll(); assertThat(mNativeWrapper.getResultMessages()).contains(requestActiveSource); Loading Loading @@ -1904,7 +1905,7 @@ public class HdmiCecLocalDeviceTvTest { mTestLooper.dispatchAll(); // Skip the LauncherX API timeout. mTestLooper.moveTimeForward(HdmiConfig.TIMEOUT_MS * 2); mTestLooper.moveTimeForward(TIMEOUT_WAIT_FOR_LAUNCHERX_API_CALL_MS); mTestLooper.dispatchAll(); assertThat(mNativeWrapper.getResultMessages()).contains(requestActiveSource); Loading Loading @@ -1941,7 +1942,7 @@ public class HdmiCecLocalDeviceTvTest { mHdmiControlService.sendCecCommand(setStreamPathFromTv); // Skip the LauncherX API timeout. mTestLooper.moveTimeForward(HdmiConfig.TIMEOUT_MS * 2); mTestLooper.moveTimeForward(TIMEOUT_WAIT_FOR_LAUNCHERX_API_CALL_MS); mTestLooper.dispatchAll(); assertThat(mNativeWrapper.getResultMessages()).doesNotContain(requestActiveSource); Loading Loading
services/core/java/com/android/server/hdmi/RequestActiveSourceAction.java +6 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.server.hdmi; import android.hardware.hdmi.HdmiControlManager; import android.hardware.hdmi.IHdmiControlCallback; import android.util.Slog; import com.android.internal.annotations.VisibleForTesting; /** * Feature action that sends <Request Active Source> message and waits for <Active Source> on TV Loading @@ -39,6 +40,10 @@ public class RequestActiveSourceAction extends HdmiCecFeatureAction { // Number of retries <Request Active Source> is sent if no device answers this message. private static final int MAX_SEND_RETRY_COUNT = 1; // Timeout to wait for the LauncherX API call to be completed. @VisibleForTesting protected static final int TIMEOUT_WAIT_FOR_LAUNCHERX_API_CALL_MS = 10000; private int mSendRetryCount = 0; Loading @@ -55,7 +60,7 @@ public class RequestActiveSourceAction extends HdmiCecFeatureAction { // We wait for default timeout to allow the message triggered by the LauncherX API call to // be sent by the TV and another default timeout in case the message has to be answered // (e.g. TV sent a <Set Stream Path> or <Routing Change>). addTimer(mState, HdmiConfig.TIMEOUT_MS * 2); addTimer(mState, TIMEOUT_WAIT_FOR_LAUNCHERX_API_CALL_MS); return true; } Loading
services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTvTest.java +6 −5 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import static com.android.server.hdmi.HdmiControlService.INITIATED_BY_ENABLE_CEC import static com.android.server.hdmi.HdmiControlService.INITIATED_BY_WAKE_UP_MESSAGE; import static com.android.server.hdmi.HdmiControlService.STANDBY_SCREEN_OFF; import static com.android.server.hdmi.HdmiControlService.WAKE_UP_SCREEN_ON; import static com.android.server.hdmi.RequestActiveSourceAction.TIMEOUT_WAIT_FOR_LAUNCHERX_API_CALL_MS; import static com.google.common.truth.Truth.assertThat; Loading Loading @@ -1792,7 +1793,7 @@ public class HdmiCecLocalDeviceTvTest { mTestLooper.dispatchAll(); // Skip the LauncherX API timeout. mTestLooper.moveTimeForward(HdmiConfig.TIMEOUT_MS * 2); mTestLooper.moveTimeForward(TIMEOUT_WAIT_FOR_LAUNCHERX_API_CALL_MS); mTestLooper.dispatchAll(); assertThat(mNativeWrapper.getResultMessages()).contains(requestActiveSource); Loading Loading @@ -1825,7 +1826,7 @@ public class HdmiCecLocalDeviceTvTest { mTestLooper.dispatchAll(); // Skip the LauncherX API timeout. mTestLooper.moveTimeForward(HdmiConfig.TIMEOUT_MS * 2); mTestLooper.moveTimeForward(TIMEOUT_WAIT_FOR_LAUNCHERX_API_CALL_MS); mTestLooper.dispatchAll(); assertThat(mNativeWrapper.getResultMessages()).contains(requestActiveSource); Loading Loading @@ -1861,7 +1862,7 @@ public class HdmiCecLocalDeviceTvTest { mTestLooper.dispatchAll(); // Skip the LauncherX API timeout. mTestLooper.moveTimeForward(HdmiConfig.TIMEOUT_MS * 2); mTestLooper.moveTimeForward(TIMEOUT_WAIT_FOR_LAUNCHERX_API_CALL_MS); mTestLooper.dispatchAll(); assertThat(mNativeWrapper.getResultMessages()).contains(requestActiveSource); Loading Loading @@ -1904,7 +1905,7 @@ public class HdmiCecLocalDeviceTvTest { mTestLooper.dispatchAll(); // Skip the LauncherX API timeout. mTestLooper.moveTimeForward(HdmiConfig.TIMEOUT_MS * 2); mTestLooper.moveTimeForward(TIMEOUT_WAIT_FOR_LAUNCHERX_API_CALL_MS); mTestLooper.dispatchAll(); assertThat(mNativeWrapper.getResultMessages()).contains(requestActiveSource); Loading Loading @@ -1941,7 +1942,7 @@ public class HdmiCecLocalDeviceTvTest { mHdmiControlService.sendCecCommand(setStreamPathFromTv); // Skip the LauncherX API timeout. mTestLooper.moveTimeForward(HdmiConfig.TIMEOUT_MS * 2); mTestLooper.moveTimeForward(TIMEOUT_WAIT_FOR_LAUNCHERX_API_CALL_MS); mTestLooper.dispatchAll(); assertThat(mNativeWrapper.getResultMessages()).doesNotContain(requestActiveSource); Loading