Mark the pendingIntent_classNotFound test as needing updated code
The tests for Connectivity will run on older versions of the module
unless you put this annotation on the test. In this case this will
happily crash some devices.
Bug: 399659876
Test: TH
Change-Id: I149883c9e461878a228687a96f04f0b4ebf2408a
diff --git a/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java b/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java
index 7292c5d..87c2b9e 100644
--- a/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java
+++ b/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java
@@ -1231,6 +1231,10 @@
* of a {@code NetworkCallback}.
*/
@Test
+ // This test is flaky before aosp/3482151 which fixed the issue in the ConnectivityService
+ // code. Unfortunately this means T can't be fixed, so don't run this test with a module
+ // that hasn't been updated.
+ @ConnectivityModuleTest
public void testRegisterNetworkCallback_withPendingIntent() {
final ConditionVariable received = new ConditionVariable();
@@ -1273,6 +1277,8 @@
// Up to R ConnectivityService can't be updated through mainline, and there was a bug
// where registering a callback with a canceled pending intent would crash the system.
@Test
+ // Running this test without aosp/3482151 will likely crash the device.
+ @ConnectivityModuleTest
@IgnoreUpTo(Build.VERSION_CODES.R)
public void testRegisterNetworkCallback_pendingIntent_classNotFound() {
final Intent intent = new Intent()
@@ -1400,12 +1406,20 @@
}
@AppModeFull(reason = "Cannot get WifiManager in instant app mode")
+ // This test is flaky before aosp/3482151 which fixed the issue in the ConnectivityService
+ // code. Unfortunately this means T can't be fixed, so don't run this test with a module
+ // that hasn't been updated.
+ @ConnectivityModuleTest
@Test
public void testRegisterNetworkRequest_identicalPendingIntents() throws Exception {
runIdenticalPendingIntentsRequestTest(false /* useListen */);
}
@AppModeFull(reason = "Cannot get WifiManager in instant app mode")
+ // This test is flaky before aosp/3482151 which fixed the issue in the ConnectivityService
+ // code. Unfortunately this means T can't be fixed, so don't run this test with a module
+ // that hasn't been updated.
+ @ConnectivityModuleTest
@Test
public void testRegisterNetworkCallback_identicalPendingIntents() throws Exception {
runIdenticalPendingIntentsRequestTest(true /* useListen */);