summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
author lifr <lifr@google.com> 2021-03-23 17:53:40 +0800
committer lifr <lifr@google.com> 2021-03-29 15:36:32 +0800
commitd5eb5cdcbc02b2fc598b7b6cbe1fba3d08d78a72 (patch)
treeace951647cd42ba12539425652da4cc3029d9df8 /tests
parent0befda4964daafaf6395e5ff5a4c68d7d264bad3 (diff)
Fix cannot success verify count of the networkAgent Config items on R
device Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkAgentConfigTest Fix: 183474500 Change-Id: Ie0fd5ba816c390bfb7bc6512d896a88482c217ec Merged-In: Ie0fd5ba816c390bfb7bc6512d896a88482c217ec
Diffstat (limited to 'tests')
-rw-r--r--tests/net/common/java/android/net/NetworkAgentConfigTest.kt9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/net/common/java/android/net/NetworkAgentConfigTest.kt b/tests/net/common/java/android/net/NetworkAgentConfigTest.kt
index fd126ad8c0b3..1e54093bf111 100644
--- a/tests/net/common/java/android/net/NetworkAgentConfigTest.kt
+++ b/tests/net/common/java/android/net/NetworkAgentConfigTest.kt
@@ -19,6 +19,7 @@ package android.net
import android.os.Build
import androidx.test.filters.SmallTest
import androidx.test.runner.AndroidJUnit4
+import com.android.modules.utils.build.SdkLevel.isAtLeastS
import com.android.testutils.DevSdkIgnoreRule
import com.android.testutils.DevSdkIgnoreRule.IgnoreUpTo
import com.android.testutils.assertParcelSane
@@ -44,7 +45,13 @@ class NetworkAgentConfigTest {
setPartialConnectivityAcceptable(false)
setUnvalidatedConnectivityAcceptable(true)
}.build()
- assertParcelSane(config, 12)
+ if (isAtLeastS()) {
+ // From S, the config will have 12 items
+ assertParcelSane(config, 12)
+ } else {
+ // For R or below, the config will have 10 items
+ assertParcelSane(config, 10)
+ }
}
@Test @IgnoreUpTo(Build.VERSION_CODES.Q)