diff options
author | Nathalie Le Clair <lcnathalie@google.com> | 2021-10-27 07:21:24 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-10-27 07:21:24 +0000 |
commit | eefec8c7a102a90ef9400d2bdedff8660fe4362f (patch) | |
tree | 76ee45ef74f4d8afe5ba0ac5bed6ec5d2296aa2f | |
parent | e056b78aa99db1568ee2e6bf4f7d0b0ef7cbcd13 (diff) | |
parent | 8a4b8bb46ceed812b3be952deabf1cf081175754 (diff) | |
download | cts-android-s-v2-preview-1.tar.gz |
Merge "CEC: Change device type checks"android-s-v2-preview-2android-s-v2-preview-1android-s-v2-beta-2android-s-v2-preview-1
25 files changed, 117 insertions, 95 deletions
diff --git a/hostsidetests/hdmicec/Android.bp b/hostsidetests/hdmicec/Android.bp index 6c746757504..93eb09b8bd8 100644 --- a/hostsidetests/hdmicec/Android.bp +++ b/hostsidetests/hdmicec/Android.bp @@ -29,6 +29,7 @@ java_test_host { "cts-tradefed", "tradefed", "compatibility-host-util", + "androidx.annotation_annotation", ], data: [ ":HdmiCecHelperApp", diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/BaseHdmiCecCtsTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/BaseHdmiCecCtsTest.java index 6a7a24defc9..0ca9569eb6d 100644 --- a/hostsidetests/hdmicec/src/android/hdmicec/cts/BaseHdmiCecCtsTest.java +++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/BaseHdmiCecCtsTest.java @@ -18,6 +18,7 @@ package android.hdmicec.cts; import static org.junit.Assume.assumeTrue; +import android.hdmicec.cts.HdmiCecConstants.CecDeviceType; import android.hdmicec.cts.error.DumpsysParseException; import com.android.tradefed.config.Option; @@ -62,7 +63,7 @@ public class BaseHdmiCecCtsTest extends BaseHostJUnit4Test { public final HdmiCecClientWrapper hdmiCecClient; public List<LogicalAddress> mDutLogicalAddresses = new ArrayList<>(); - public int mTestDeviceType = HdmiCecConstants.CEC_DEVICE_TYPE_UNKNOWN; + public @CecDeviceType int mTestDeviceType; /** * Constructor for BaseHdmiCecCtsTest. @@ -84,10 +85,10 @@ public class BaseHdmiCecCtsTest extends BaseHostJUnit4Test { * Constructor for BaseHdmiCecCtsTest. * * @param testDeviceType The primary test device type. This is used to determine to which - * logical address of the DUT messages should be sent. + * logical address of the DUT messages should be sent. * @param clientParams Extra parameters to use when launching cec-client */ - public BaseHdmiCecCtsTest(int testDeviceType, String... clientParams) { + public BaseHdmiCecCtsTest(@CecDeviceType int testDeviceType, String... clientParams) { this.hdmiCecClient = new HdmiCecClientWrapper(clientParams); mTestDeviceType = testDeviceType; } @@ -113,16 +114,17 @@ public class BaseHdmiCecCtsTest extends BaseHostJUnit4Test { return new RequiredFeatureRule(testPointer, HdmiCecConstants.LEANBACK_FEATURE); } - public static TestRule requiresDeviceType(BaseHostJUnit4Test testPointer, - LogicalAddress dutLogicalAddress) { + public static TestRule requiresDeviceType( + BaseHostJUnit4Test testPointer, @CecDeviceType int dutDeviceType) { return RequiredPropertyRule.asCsvContainsValue( - testPointer, - HdmiCecConstants.HDMI_DEVICE_TYPE_PROPERTY, - dutLogicalAddress.getDeviceTypeString()); + testPointer, + HdmiCecConstants.HDMI_DEVICE_TYPE_PROPERTY, + Integer.toString(dutDeviceType)); } /** This rule will skip the test if the DUT belongs to the HDMI device type deviceType. */ - public static TestRule skipDeviceType(BaseHostJUnit4Test testPointer, int deviceType) { + public static TestRule skipDeviceType( + BaseHostJUnit4Test testPointer, @CecDeviceType int deviceType) { return RequiredPropertyRule.asCsvDoesNotContainsValue( testPointer, HdmiCecConstants.HDMI_DEVICE_TYPE_PROPERTY, @@ -277,7 +279,7 @@ public class BaseHdmiCecCtsTest extends BaseHostJUnit4Test { "Could not parse " + addressType.getAddressType() + " from dumpsys."); } - public boolean hasDeviceType(int deviceType) { + public boolean hasDeviceType(@CecDeviceType int deviceType) { for (LogicalAddress address : mDutLogicalAddresses) { if (address.getDeviceType() == deviceType) { return true; diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/HdmiCecConstants.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/HdmiCecConstants.java index 4b6c823f19e..44af5620bea 100644 --- a/hostsidetests/hdmicec/src/android/hdmicec/cts/HdmiCecConstants.java +++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/HdmiCecConstants.java @@ -16,6 +16,8 @@ package android.hdmicec.cts; +import androidx.annotation.IntDef; + import java.io.File; public final class HdmiCecConstants { @@ -35,8 +37,6 @@ public final class HdmiCecConstants { public static final int TV_PHYSICAL_ADDRESS = 0x0000; public static final int PHYSICAL_ADDRESS_LENGTH = 4; /* Num nibbles in CEC message */ - public static final int PLAYBACK_DEVICE_TYPE = 0x04; - public static final int CEC_CONTROL_SELECT = 0x0; public static final int CEC_CONTROL_UP = 0x1; public static final int CEC_CONTROL_DOWN = 0x2; @@ -53,6 +53,19 @@ public final class HdmiCecConstants { public static final int UNRECOGNIZED_OPCODE = 0x0; + @IntDef( + value = { + CEC_DEVICE_TYPE_UNKNOWN, + CEC_DEVICE_TYPE_TV, + CEC_DEVICE_TYPE_RECORDER, + CEC_DEVICE_TYPE_RESERVED, + CEC_DEVICE_TYPE_TUNER, + CEC_DEVICE_TYPE_PLAYBACK_DEVICE, + CEC_DEVICE_TYPE_AUDIO_SYSTEM, + CEC_DEVICE_TYPE_SWITCH + }) + public @interface CecDeviceType {} + public static final int CEC_DEVICE_TYPE_UNKNOWN = -1; public static final int CEC_DEVICE_TYPE_TV = 0; public static final int CEC_DEVICE_TYPE_RECORDER = 1; diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/LogicalAddress.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/LogicalAddress.java index 70a066674ca..eeb81b1fe08 100644 --- a/hostsidetests/hdmicec/src/android/hdmicec/cts/LogicalAddress.java +++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/LogicalAddress.java @@ -16,6 +16,8 @@ package android.hdmicec.cts; +import android.hdmicec.cts.HdmiCecConstants.CecDeviceType; + import java.util.HashMap; import java.util.Map; @@ -60,7 +62,7 @@ public enum LogicalAddress { return this.address; } - public int getDeviceType() { + public @CecDeviceType int getDeviceType() { switch (this) { case PLAYBACK_1: case PLAYBACK_2: diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecAudioReturnChannelControlTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecAudioReturnChannelControlTest.java index 18378dda157..f652d0c3bfd 100644 --- a/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecAudioReturnChannelControlTest.java +++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecAudioReturnChannelControlTest.java @@ -46,11 +46,12 @@ public final class HdmiCecAudioReturnChannelControlTest extends BaseHdmiCecCtsTe @Rule public RuleChain ruleChain = - RuleChain - .outerRule(CecRules.requiresCec(this)) - .around(CecRules.requiresLeanback(this)) - .around(CecRules.requiresDeviceType(this, AUDIO_DEVICE)) - .around(hdmiCecClient); + RuleChain.outerRule(CecRules.requiresCec(this)) + .around(CecRules.requiresLeanback(this)) + .around( + CecRules.requiresDeviceType( + this, HdmiCecConstants.CEC_DEVICE_TYPE_AUDIO_SYSTEM)) + .around(hdmiCecClient); private void checkArcIsInitiated() throws CecClientWrapperException { try { diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecInvalidMessagesTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecInvalidMessagesTest.java index f8d7eb7eeab..1b36a612caf 100644 --- a/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecInvalidMessagesTest.java +++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecInvalidMessagesTest.java @@ -59,11 +59,12 @@ public final class HdmiCecInvalidMessagesTest extends BaseHdmiCecCtsTest { @Rule public RuleChain ruleChain = - RuleChain - .outerRule(CecRules.requiresCec(this)) - .around(CecRules.requiresLeanback(this)) - .around(CecRules.requiresDeviceType(this, AUDIO_DEVICE)) - .around(hdmiCecClient); + RuleChain.outerRule(CecRules.requiresCec(this)) + .around(CecRules.requiresLeanback(this)) + .around( + CecRules.requiresDeviceType( + this, HdmiCecConstants.CEC_DEVICE_TYPE_AUDIO_SYSTEM)) + .around(hdmiCecClient); private void checkArcIsInitiated() throws CecClientWrapperException { try { diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecLogicalAddressTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecLogicalAddressTest.java index 8e4e89d35d0..6c251a25407 100644 --- a/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecLogicalAddressTest.java +++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecLogicalAddressTest.java @@ -49,11 +49,12 @@ public final class HdmiCecLogicalAddressTest extends BaseHdmiCecCtsTest { @Rule public RuleChain ruleChain = - RuleChain - .outerRule(CecRules.requiresCec(this)) - .around(CecRules.requiresLeanback(this)) - .around(CecRules.requiresDeviceType(this, AUDIO_DEVICE)) - .around(hdmiCecClient); + RuleChain.outerRule(CecRules.requiresCec(this)) + .around(CecRules.requiresLeanback(this)) + .around( + CecRules.requiresDeviceType( + this, HdmiCecConstants.CEC_DEVICE_TYPE_AUDIO_SYSTEM)) + .around(hdmiCecClient); /** * Test 10.2.5-1 diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecRemoteControlPassThroughTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecRemoteControlPassThroughTest.java index 120e9ac4cf4..c73506767d9 100644 --- a/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecRemoteControlPassThroughTest.java +++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecRemoteControlPassThroughTest.java @@ -41,11 +41,12 @@ public final class HdmiCecRemoteControlPassThroughTest extends BaseHdmiCecCtsTes @Rule public RuleChain ruleChain = - RuleChain - .outerRule(CecRules.requiresCec(this)) - .around(CecRules.requiresLeanback(this)) - .around(CecRules.requiresDeviceType(this, LogicalAddress.AUDIO_SYSTEM)) - .around(hdmiCecClient); + RuleChain.outerRule(CecRules.requiresCec(this)) + .around(CecRules.requiresLeanback(this)) + .around( + CecRules.requiresDeviceType( + this, HdmiCecConstants.CEC_DEVICE_TYPE_AUDIO_SYSTEM)) + .around(hdmiCecClient); /** * Test 11.2.13-1 diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecSystemAudioModeTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecSystemAudioModeTest.java index 2262f1863e1..94b3e4a6025 100644 --- a/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecSystemAudioModeTest.java +++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecSystemAudioModeTest.java @@ -54,11 +54,12 @@ public final class HdmiCecSystemAudioModeTest extends BaseHdmiCecCtsTest { @Rule public RuleChain ruleChain = - RuleChain - .outerRule(CecRules.requiresCec(this)) - .around(CecRules.requiresLeanback(this)) - .around(CecRules.requiresDeviceType(this, AUDIO_DEVICE)) - .around(hdmiCecClient); + RuleChain.outerRule(CecRules.requiresCec(this)) + .around(CecRules.requiresLeanback(this)) + .around( + CecRules.requiresDeviceType( + this, HdmiCecConstants.CEC_DEVICE_TYPE_AUDIO_SYSTEM)) + .around(hdmiCecClient); public void sendSystemAudioModeTermination() throws Exception { hdmiCecClient.sendCecMessage(LogicalAddress.TV, AUDIO_DEVICE, diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecActiveTrackingTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecActiveTrackingTest.java index 8615c184f60..76c0688d733 100644 --- a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecActiveTrackingTest.java +++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecActiveTrackingTest.java @@ -52,7 +52,8 @@ public final class HdmiCecActiveTrackingTest extends BaseHdmiCecCtsTest { RuleChain .outerRule(CecRules.requiresCec(this)) .around(CecRules.requiresLeanback(this)) - .around(CecRules.requiresDeviceType(this, LogicalAddress.PLAYBACK_1)) + .around(CecRules.requiresDeviceType( + this, HdmiCecConstants.CEC_DEVICE_TYPE_PLAYBACK_DEVICE)) .around(hdmiCecClient); private int createUnusedPhysicalAddress(int usedPhysicalAddress) { diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecDeviceOsdNameTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecDeviceOsdNameTest.java index 561b57578c0..754a752736f 100644 --- a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecDeviceOsdNameTest.java +++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecDeviceOsdNameTest.java @@ -39,19 +39,18 @@ import org.junit.Test; @RunWith(DeviceJUnit4ClassRunner.class) public final class HdmiCecDeviceOsdNameTest extends BaseHdmiCecCtsTest { - private static final LogicalAddress PLAYBACK_DEVICE = LogicalAddress.PLAYBACK_1; - public HdmiCecDeviceOsdNameTest() { super(HdmiCecConstants.CEC_DEVICE_TYPE_PLAYBACK_DEVICE); } @Rule public RuleChain ruleChain = - RuleChain - .outerRule(CecRules.requiresCec(this)) - .around(CecRules.requiresLeanback(this)) - .around(CecRules.requiresDeviceType(this, PLAYBACK_DEVICE)) - .around(hdmiCecClient); + RuleChain.outerRule(CecRules.requiresCec(this)) + .around(CecRules.requiresLeanback(this)) + .around( + CecRules.requiresDeviceType( + this, HdmiCecConstants.CEC_DEVICE_TYPE_PLAYBACK_DEVICE)) + .around(hdmiCecClient); /** * Test 11.2.11-1a diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecDeviceSelectForPlaybackTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecDeviceSelectForPlaybackTest.java index 21e08f0396c..d46150b7a97 100644 --- a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecDeviceSelectForPlaybackTest.java +++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecDeviceSelectForPlaybackTest.java @@ -45,10 +45,11 @@ public class HdmiCecDeviceSelectForPlaybackTest extends BaseHdmiCecCtsTest { @Rule public RuleChain ruleChain = - RuleChain - .outerRule(CecRules.requiresCec(this)) + RuleChain.outerRule(CecRules.requiresCec(this)) .around(CecRules.requiresLeanback(this)) - .around(CecRules.requiresDeviceType(this, LogicalAddress.PLAYBACK_1)) + .around( + CecRules.requiresDeviceType( + this, HdmiCecConstants.CEC_DEVICE_TYPE_PLAYBACK_DEVICE)) .around(hdmiCecClient); private String setPowerStateChangeOnActiveSourceLost(String valToSet) throws Exception { diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecOneTouchPlayTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecOneTouchPlayTest.java index 1fa1702440a..8ba5f784e38 100644 --- a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecOneTouchPlayTest.java +++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecOneTouchPlayTest.java @@ -19,16 +19,12 @@ package android.hdmicec.cts.playback; import android.hdmicec.cts.BaseHdmiCecCtsTest; import android.hdmicec.cts.CecMessage; import android.hdmicec.cts.CecOperand; -import android.hdmicec.cts.HdmiCecClientWrapper; import android.hdmicec.cts.HdmiCecConstants; import android.hdmicec.cts.LogicalAddress; -import android.hdmicec.cts.RequiredFeatureRule; -import android.hdmicec.cts.RequiredPropertyRule; import com.android.tradefed.device.ITestDevice; import com.android.tradefed.testtype.DeviceJUnit4ClassRunner; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.RuleChain; @@ -58,11 +54,12 @@ public final class HdmiCecOneTouchPlayTest extends BaseHdmiCecCtsTest { @Rule public RuleChain ruleChain = - RuleChain - .outerRule(CecRules.requiresCec(this)) - .around(CecRules.requiresLeanback(this)) - .around(CecRules.requiresDeviceType(this, LogicalAddress.PLAYBACK_1)) - .around(hdmiCecClient); + RuleChain.outerRule(CecRules.requiresCec(this)) + .around(CecRules.requiresLeanback(this)) + .around( + CecRules.requiresDeviceType( + this, HdmiCecConstants.CEC_DEVICE_TYPE_PLAYBACK_DEVICE)) + .around(hdmiCecClient); /** * Test 11.2.1-1 diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecPowerStatusTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecPowerStatusTest.java index 2a5485b797b..38344436e9e 100644 --- a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecPowerStatusTest.java +++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecPowerStatusTest.java @@ -47,10 +47,11 @@ public final class HdmiCecPowerStatusTest extends BaseHdmiCecCtsTest { @Rule public RuleChain ruleChain = - RuleChain - .outerRule(CecRules.requiresCec(this)) + RuleChain.outerRule(CecRules.requiresCec(this)) .around(CecRules.requiresLeanback(this)) - .around(CecRules.requiresDeviceType(this, LogicalAddress.PLAYBACK_1)) + .around( + CecRules.requiresDeviceType( + this, HdmiCecConstants.CEC_DEVICE_TYPE_PLAYBACK_DEVICE)) .around(hdmiCecClient); /** diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecRemoteControlPassThroughTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecRemoteControlPassThroughTest.java index bc9f49910e9..c0ebfb88e98 100644 --- a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecRemoteControlPassThroughTest.java +++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecRemoteControlPassThroughTest.java @@ -43,11 +43,12 @@ public final class HdmiCecRemoteControlPassThroughTest extends BaseHdmiCecCtsTes @Rule public RuleChain ruleChain = - RuleChain - .outerRule(CecRules.requiresCec(this)) - .around(CecRules.requiresLeanback(this)) - .around(CecRules.requiresDeviceType(this, LogicalAddress.PLAYBACK_1)) - .around(hdmiCecClient); + RuleChain.outerRule(CecRules.requiresCec(this)) + .around(CecRules.requiresLeanback(this)) + .around( + CecRules.requiresDeviceType( + this, HdmiCecConstants.CEC_DEVICE_TYPE_PLAYBACK_DEVICE)) + .around(hdmiCecClient); /** * Test 11.2.13-1 diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecRoutingControlTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecRoutingControlTest.java index 9695351429c..e81bbb44587 100644 --- a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecRoutingControlTest.java +++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecRoutingControlTest.java @@ -50,11 +50,12 @@ public final class HdmiCecRoutingControlTest extends BaseHdmiCecCtsTest { @Rule public RuleChain ruleChain = - RuleChain - .outerRule(CecRules.requiresCec(this)) - .around(CecRules.requiresLeanback(this)) - .around(CecRules.requiresDeviceType(this, LogicalAddress.PLAYBACK_1)) - .around(hdmiCecClient); + RuleChain.outerRule(CecRules.requiresCec(this)) + .around(CecRules.requiresLeanback(this)) + .around( + CecRules.requiresDeviceType( + this, HdmiCecConstants.CEC_DEVICE_TYPE_PLAYBACK_DEVICE)) + .around(hdmiCecClient); private String setPowerControlMode(String valToSet) throws Exception { String val = getSettingsValue(POWER_CONTROL_MODE); diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecSystemInformationTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecSystemInformationTest.java index bb8afa8276c..1901ea44c83 100644 --- a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecSystemInformationTest.java +++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecSystemInformationTest.java @@ -26,7 +26,6 @@ import android.hdmicec.cts.CecOperand; import android.hdmicec.cts.HdmiCecConstants; import android.hdmicec.cts.LogicalAddress; -import com.android.tradefed.device.ITestDevice; import com.android.tradefed.testtype.DeviceJUnit4ClassRunner; import org.junit.Rule; @@ -42,10 +41,11 @@ public final class HdmiCecSystemInformationTest extends BaseHdmiCecCtsTest { @Rule public RuleChain ruleChain = - RuleChain - .outerRule(CecRules.requiresCec(this)) + RuleChain.outerRule(CecRules.requiresCec(this)) .around(CecRules.requiresLeanback(this)) - .around(CecRules.requiresDeviceType(this, LogicalAddress.PLAYBACK_1)) + .around( + CecRules.requiresDeviceType( + this, HdmiCecConstants.CEC_DEVICE_TYPE_PLAYBACK_DEVICE)) .around(hdmiCecClient); public HdmiCecSystemInformationTest() { diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecTvPowerToggleTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecTvPowerToggleTest.java index e20a9de6b12..d66cd0782fe 100644 --- a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecTvPowerToggleTest.java +++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecTvPowerToggleTest.java @@ -51,12 +51,14 @@ public final class HdmiCecTvPowerToggleTest extends BaseHdmiCecCtsTest { private static final LogicalAddress PLAYBACK_DEVICE = LogicalAddress.PLAYBACK_1; private static final String POWER_CONTROL_MODE = "hdmi_control_send_standby_on_sleep"; + @Rule public RuleChain ruleChain = - RuleChain - .outerRule(CecRules.requiresCec(this)) + RuleChain.outerRule(CecRules.requiresCec(this)) .around(CecRules.requiresLeanback(this)) - .around(CecRules.requiresDeviceType(this, LogicalAddress.PLAYBACK_1)) + .around( + CecRules.requiresDeviceType( + this, HdmiCecConstants.CEC_DEVICE_TYPE_PLAYBACK_DEVICE)) .around(hdmiCecClient); public HdmiCecTvPowerToggleTest() { diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/tv/HdmiCecAudioReturnChannelControlTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/tv/HdmiCecAudioReturnChannelControlTest.java index d17d1b6fd28..2363df98776 100644 --- a/hostsidetests/hdmicec/src/android/hdmicec/cts/tv/HdmiCecAudioReturnChannelControlTest.java +++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/tv/HdmiCecAudioReturnChannelControlTest.java @@ -36,8 +36,6 @@ import org.junit.runner.RunWith; @RunWith(DeviceJUnit4ClassRunner.class) public final class HdmiCecAudioReturnChannelControlTest extends BaseHdmiCecCtsTest { - private static final LogicalAddress TV_DEVICE = LogicalAddress.TV; - public HdmiCecAudioReturnChannelControlTest() { super(HdmiCecConstants.CEC_DEVICE_TYPE_TV, "-t", "a"); } @@ -46,7 +44,7 @@ public final class HdmiCecAudioReturnChannelControlTest extends BaseHdmiCecCtsTe public RuleChain ruleChain = RuleChain.outerRule(CecRules.requiresCec(this)) .around(CecRules.requiresLeanback(this)) - .around(CecRules.requiresDeviceType(this, TV_DEVICE)) + .around(CecRules.requiresDeviceType(this, HdmiCecConstants.CEC_DEVICE_TYPE_TV)) .around(hdmiCecClient); /** diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/tv/HdmiCecRemoteControlPassThroughTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/tv/HdmiCecRemoteControlPassThroughTest.java index 5cc75b99059..e15d634169a 100644 --- a/hostsidetests/hdmicec/src/android/hdmicec/cts/tv/HdmiCecRemoteControlPassThroughTest.java +++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/tv/HdmiCecRemoteControlPassThroughTest.java @@ -22,23 +22,23 @@ import static com.google.common.truth.Truth.assertWithMessage; import android.hdmicec.cts.BaseHdmiCecCtsTest; import android.hdmicec.cts.CecMessage; import android.hdmicec.cts.CecOperand; -import android.hdmicec.cts.error.CecClientWrapperException; -import android.hdmicec.cts.error.ErrorCodes; import android.hdmicec.cts.HdmiCecConstants; import android.hdmicec.cts.LogicalAddress; +import android.hdmicec.cts.error.CecClientWrapperException; +import android.hdmicec.cts.error.ErrorCodes; import com.android.tradefed.device.ITestDevice; import com.android.tradefed.testtype.DeviceJUnit4ClassRunner; import org.junit.Before; import org.junit.Rule; +import org.junit.Test; import org.junit.rules.RuleChain; import org.junit.runner.RunWith; -import org.junit.Test; -import java.util.HashMap; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.List; /** HDMI CEC test to check Remote Control Pass Through behaviour (Sections 11.1.13) */ @@ -51,7 +51,7 @@ public final class HdmiCecRemoteControlPassThroughTest extends BaseHdmiCecCtsTes public RuleChain ruleChain = RuleChain.outerRule(CecRules.requiresCec(this)) .around(CecRules.requiresLeanback(this)) - .around(CecRules.requiresDeviceType(this, LogicalAddress.TV)) + .around(CecRules.requiresDeviceType(this, HdmiCecConstants.CEC_DEVICE_TYPE_TV)) .around(hdmiCecClient); public HdmiCecRemoteControlPassThroughTest() { diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/tv/HdmiCecRoutingControlTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/tv/HdmiCecRoutingControlTest.java index cc7d89e9079..a588ba1ba67 100644 --- a/hostsidetests/hdmicec/src/android/hdmicec/cts/tv/HdmiCecRoutingControlTest.java +++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/tv/HdmiCecRoutingControlTest.java @@ -45,7 +45,7 @@ public final class HdmiCecRoutingControlTest extends BaseHdmiCecCtsTest { public RuleChain ruleChain = RuleChain.outerRule(CecRules.requiresCec(this)) .around(CecRules.requiresLeanback(this)) - .around(CecRules.requiresDeviceType(this, LogicalAddress.TV)) + .around(CecRules.requiresDeviceType(this, HdmiCecConstants.CEC_DEVICE_TYPE_TV)) .around(hdmiCecClient); public HdmiCecRoutingControlTest() { diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/tv/HdmiCecSystemAudioControlTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/tv/HdmiCecSystemAudioControlTest.java index 77ac08ab4c6..586a7d4be32 100644 --- a/hostsidetests/hdmicec/src/android/hdmicec/cts/tv/HdmiCecSystemAudioControlTest.java +++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/tv/HdmiCecSystemAudioControlTest.java @@ -44,7 +44,7 @@ public final class HdmiCecSystemAudioControlTest extends BaseHdmiCecCtsTest { public RuleChain ruleChain = RuleChain.outerRule(CecRules.requiresCec(this)) .around(CecRules.requiresLeanback(this)) - .around(CecRules.requiresDeviceType(this, LogicalAddress.TV)) + .around(CecRules.requiresDeviceType(this, HdmiCecConstants.CEC_DEVICE_TYPE_TV)) .around(hdmiCecClient); public HdmiCecSystemAudioControlTest() { diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/tv/HdmiCecSystemInformationTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/tv/HdmiCecSystemInformationTest.java index 30b92929c58..83b7c4ba767 100644 --- a/hostsidetests/hdmicec/src/android/hdmicec/cts/tv/HdmiCecSystemInformationTest.java +++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/tv/HdmiCecSystemInformationTest.java @@ -41,7 +41,7 @@ public final class HdmiCecSystemInformationTest extends BaseHdmiCecCtsTest { public RuleChain ruleChain = RuleChain.outerRule(CecRules.requiresCec(this)) .around(CecRules.requiresLeanback(this)) - .around(CecRules.requiresDeviceType(this, LogicalAddress.TV)) + .around(CecRules.requiresDeviceType(this, HdmiCecConstants.CEC_DEVICE_TYPE_TV)) .around(hdmiCecClient); public HdmiCecSystemInformationTest() { diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/tv/HdmiCecTvOneTouchPlayTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/tv/HdmiCecTvOneTouchPlayTest.java index 8106124458c..5329f19cbba 100644 --- a/hostsidetests/hdmicec/src/android/hdmicec/cts/tv/HdmiCecTvOneTouchPlayTest.java +++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/tv/HdmiCecTvOneTouchPlayTest.java @@ -16,6 +16,8 @@ package android.hdmicec.cts.tv; +import static com.google.common.truth.Truth.assertWithMessage; + import android.hdmicec.cts.BaseHdmiCecCtsTest; import android.hdmicec.cts.CecMessage; import android.hdmicec.cts.CecOperand; @@ -24,7 +26,6 @@ import android.hdmicec.cts.HdmiControlManagerUtility; import android.hdmicec.cts.LogicalAddress; import com.android.tradefed.testtype.DeviceJUnit4ClassRunner; -import static com.google.common.truth.Truth.assertWithMessage; import org.junit.Rule; import org.junit.Test; @@ -39,7 +40,6 @@ import java.util.concurrent.TimeUnit; @RunWith(DeviceJUnit4ClassRunner.class) public class HdmiCecTvOneTouchPlayTest extends BaseHdmiCecCtsTest { - private static final LogicalAddress TV_DEVICE = LogicalAddress.TV; private static final int WAIT_TIME_MS = 300; private static final int SLEEP_TIMESTEP_SECONDS = 1; @@ -60,7 +60,7 @@ public class HdmiCecTvOneTouchPlayTest extends BaseHdmiCecCtsTest { public RuleChain ruleChain = RuleChain.outerRule(CecRules.requiresCec(this)) .around(CecRules.requiresLeanback(this)) - .around(CecRules.requiresDeviceType(this, TV_DEVICE)) + .around(CecRules.requiresDeviceType(this, HdmiCecConstants.CEC_DEVICE_TYPE_TV)) .around(hdmiCecClient); /** diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/tv/HdmiCecTvStandbyTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/tv/HdmiCecTvStandbyTest.java index f4ede4081c1..7a861a1b502 100644 --- a/hostsidetests/hdmicec/src/android/hdmicec/cts/tv/HdmiCecTvStandbyTest.java +++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/tv/HdmiCecTvStandbyTest.java @@ -36,8 +36,6 @@ import static com.google.common.truth.Truth.assertWithMessage; @RunWith(DeviceJUnit4ClassRunner.class) public class HdmiCecTvStandbyTest extends BaseHdmiCecCtsTest { - private static final LogicalAddress TV_DEVICE = LogicalAddress.TV; - public HdmiCecTvStandbyTest() { super(HdmiCecConstants.CEC_DEVICE_TYPE_TV); } @@ -46,7 +44,7 @@ public class HdmiCecTvStandbyTest extends BaseHdmiCecCtsTest { public RuleChain ruleChain = RuleChain.outerRule(CecRules.requiresCec(this)) .around(CecRules.requiresLeanback(this)) - .around(CecRules.requiresDeviceType(this, TV_DEVICE)) + .around(CecRules.requiresDeviceType(this, HdmiCecConstants.CEC_DEVICE_TYPE_TV)) .around(hdmiCecClient); private static final String HDMI_CONTROL_DEVICE_AUTO_OFF = |