Remove NetworkIdentitySet usage in CTS

NetworkIdentitySet is hidden API and may change on subsequent module
updates.
Use the module_lib NetworkStatsCollection.Key constructor that uses a
set of NetworkIdentity instead.

Bug: 217129444
Test: atest NetworkStatsCollectionTest
Change-Id: Icd1160ae920059306c3319f7298707f1e14cbb48
This commit is contained in:
Remi NGUYEN VAN 2022-05-02 14:53:22 +09:00
commit 7b0c61d0bd

View file

@ -16,7 +16,7 @@
package android.net.netstats
import android.net.NetworkIdentitySet
import android.net.NetworkIdentity
import android.net.NetworkStatsCollection
import android.net.NetworkStatsHistory
import androidx.test.filters.SmallTest
@ -40,7 +40,7 @@ class NetworkStatsCollectionTest {
@Test
fun testBuilder() {
val ident = NetworkIdentitySet()
val ident = setOf<NetworkIdentity>()
val key1 = NetworkStatsCollection.Key(ident, /* uid */ 0, /* set */ 0, /* tag */ 0)
val key2 = NetworkStatsCollection.Key(ident, /* uid */ 1, /* set */ 0, /* tag */ 0)
val bucketDuration = 10L
@ -63,4 +63,4 @@ class NetworkStatsCollectionTest {
val actualHistory = actualEntries[key1] ?: fail("There should be an entry for $key1")
assertEquals(history1.entries, actualHistory.entries)
}
}
}