Support shouldTestUApis
This is needed by follow-up CL to properly skip tests on T, T-
devices.
Test: TH
Bug: 258471863
Change-Id: If292751ee7ff3bb6e3683eef50066b445e2ca731
diff --git a/tests/cts/net/src/android/net/cts/TestUtils.java b/tests/cts/net/src/android/net/cts/TestUtils.java
index 001aa01..6180845 100644
--- a/tests/cts/net/src/android/net/cts/TestUtils.java
+++ b/tests/cts/net/src/android/net/cts/TestUtils.java
@@ -16,8 +16,6 @@
package android.net.cts;
-import static com.android.testutils.DevSdkIgnoreRuleKt.SC_V2;
-
import android.os.Build;
import com.android.modules.utils.build.SdkLevel;
@@ -37,11 +35,18 @@
}
/**
- * Whether to test T+ APIs. This requires a) that the test be running on an S+ device, and
+ * Whether to test T+ APIs. This requires a) that the test be running on an T+ device, and
* b) that the code be compiled against shims new enough to access these APIs.
*/
public static boolean shouldTestTApis() {
- // TODO: replace SC_V2 with Build.VERSION_CODES.S_V2 when it's available in mainline branch.
- return SdkLevel.isAtLeastT() && ConstantsShim.VERSION > SC_V2;
+ return SdkLevel.isAtLeastT() && ConstantsShim.VERSION > Build.VERSION_CODES.S_V2;
+ }
+
+ /**
+ * Whether to test U+ APIs. This requires a) that the test be running on an U+ device, and
+ * b) that the code be compiled against shims new enough to access these APIs.
+ */
+ public static boolean shouldTestUApis() {
+ return SdkLevel.isAtLeastU() && ConstantsShim.VERSION > Build.VERSION_CODES.TIRAMISU;
}
}