Merge "Remove hidden connectivity API usage in tests" into sc-dev
diff --git a/tests/JobScheduler/src/android/jobscheduler/cts/ConnectivityConstraintTest.java b/tests/JobScheduler/src/android/jobscheduler/cts/ConnectivityConstraintTest.java
index e9fd3ae..097a6fb 100644
--- a/tests/JobScheduler/src/android/jobscheduler/cts/ConnectivityConstraintTest.java
+++ b/tests/JobScheduler/src/android/jobscheduler/cts/ConnectivityConstraintTest.java
@@ -961,8 +961,7 @@
}
@Override
- public void onAvailable(Network network, NetworkCapabilities networkCapabilities,
- LinkProperties linkProperties, boolean blocked) {
+ public void onAvailable(Network network) {
// Available doesn't mean it's the active network. We need to check that separately.
checkActiveNetwork();
}
diff --git a/tests/JobScheduler/src/android/jobscheduler/cts/JobInfoTest.java b/tests/JobScheduler/src/android/jobscheduler/cts/JobInfoTest.java
index 26bda48..eece252 100644
--- a/tests/JobScheduler/src/android/jobscheduler/cts/JobInfoTest.java
+++ b/tests/JobScheduler/src/android/jobscheduler/cts/JobInfoTest.java
@@ -16,7 +16,6 @@
package android.jobscheduler.cts;
-import static android.net.ConnectivityDiagnosticsManager.persistableBundleEquals;
import static android.net.NetworkCapabilities.NET_CAPABILITY_INTERNET;
import static android.net.NetworkCapabilities.NET_CAPABILITY_VALIDATED;
@@ -153,7 +152,10 @@
.setPersisted(true)
.setExtras(pb)
.build();
- assertTrue(persistableBundleEquals(pb, ji.getExtras()));
+ final PersistableBundle extras = ji.getExtras();
+ assertNotNull(extras);
+ assertEquals(1, extras.keySet().size());
+ assertEquals(42, extras.getInt("random_key"));
// Confirm JobScheduler accepts the JobInfo object.
mJobScheduler.schedule(ji);
}
diff --git a/tests/JobScheduler/src/android/jobscheduler/cts/JobParametersTest.java b/tests/JobScheduler/src/android/jobscheduler/cts/JobParametersTest.java
index 31e6cd9..b3b6cb3 100644
--- a/tests/JobScheduler/src/android/jobscheduler/cts/JobParametersTest.java
+++ b/tests/JobScheduler/src/android/jobscheduler/cts/JobParametersTest.java
@@ -16,8 +16,6 @@
package android.jobscheduler.cts;
-import static android.net.ConnectivityDiagnosticsManager.persistableBundleEquals;
-
import android.app.job.JobInfo;
import android.app.job.JobParameters;
import android.content.ClipData;
@@ -66,7 +64,10 @@
assertTrue("Job didn't fire immediately", kTestEnvironment.awaitExecution());
JobParameters params = kTestEnvironment.getLastStartJobParameters();
- assertTrue(persistableBundleEquals(pb, params.getExtras()));
+ final PersistableBundle extras = params.getExtras();
+ assertNotNull(extras);
+ assertEquals(1, extras.keySet().size());
+ assertEquals(42, extras.getInt("random_key"));
}
public void testExpedited() throws Exception {