diff options
| author | lifr <lifr@google.com> | 2021-11-18 02:37:28 +0800 |
|---|---|---|
| committer | Frank <lifr@google.com> | 2022-03-01 16:43:28 +0800 |
| commit | 8ba46d804fd7b743fa7fc71c532f02441371ea42 (patch) | |
| tree | 071e66f9cd08ff6dc38722ef691a0515377fdcf5 /tests/unit/java/android/net/NetworkStatsCollectionTest.java | |
| parent | 87db609348ddc8b004230196568c8eae6419d3d7 (diff) | |
[SUBID01-1]Grow NetworkIdentity to include a new mSubId field
In the previous design of NSS and NPMS, those only had IMSI to identify
the cell network. Now the telephony has created the "subId" handle,
which is the preferred mechanism for identifying subscribers.
This commit adds NetworkStats support for subscriberId as a part of
the network identity key
Bug: 80526261
Test: atest NetworkTemplateTest NetworkStatsCollectionTest
NetworkStatsServiceTest NetworkIdentityTest
Ignore-AOSP-First: merge conflict resolutions
(cherry-picked from ag/16826535)
Change-Id: I8549b11d0fcfc5a9426724d6b90de27b707cb77c
Merged-In: I8549b11d0fcfc5a9426724d6b90de27b707cb77c
Diffstat (limited to 'tests/unit/java/android/net/NetworkStatsCollectionTest.java')
| -rw-r--r-- | tests/unit/java/android/net/NetworkStatsCollectionTest.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/unit/java/android/net/NetworkStatsCollectionTest.java b/tests/unit/java/android/net/NetworkStatsCollectionTest.java index c27ee931eb..32c106dbbd 100644 --- a/tests/unit/java/android/net/NetworkStatsCollectionTest.java +++ b/tests/unit/java/android/net/NetworkStatsCollectionTest.java @@ -87,6 +87,7 @@ public class NetworkStatsCollectionTest { private static final String TEST_FILE = "test.bin"; private static final String TEST_IMSI = "310260000000000"; + private static final int TEST_SUBID = 1; private static final long TIME_A = 1326088800000L; // UTC: Monday 9th January 2012 06:00:00 AM private static final long TIME_B = 1326110400000L; // UTC: Monday 9th January 2012 12:00:00 PM @@ -213,7 +214,7 @@ public class NetworkStatsCollectionTest { final NetworkStats.Entry entry = new NetworkStats.Entry(); final NetworkIdentitySet identSet = new NetworkIdentitySet(); identSet.add(new NetworkIdentity(TYPE_MOBILE, TelephonyManager.NETWORK_TYPE_UNKNOWN, - TEST_IMSI, null, false, true, true, OEM_NONE)); + TEST_IMSI, null, false, true, true, OEM_NONE, TEST_SUBID)); int myUid = Process.myUid(); int otherUidInSameUser = Process.myUid() + 1; @@ -475,7 +476,7 @@ public class NetworkStatsCollectionTest { final NetworkStatsCollection large = new NetworkStatsCollection(HOUR_IN_MILLIS); final NetworkIdentitySet ident = new NetworkIdentitySet(); ident.add(new NetworkIdentity(ConnectivityManager.TYPE_MOBILE, -1, TEST_IMSI, null, - false, true, true, OEM_NONE)); + false, true, true, OEM_NONE, TEST_SUBID)); large.recordData(ident, UID_ALL, SET_ALL, TAG_NONE, TIME_A, TIME_B, new NetworkStats.Entry(12_730_893_164L, 1, 0, 0, 0)); |
