Home
last modified time | relevance | path

Searched refs:NetworkStats (Results 1 – 25 of 69) sorted by relevance

123

/frameworks/base/tests/net/java/android/net/
DNetworkStatsTest.java19 import static android.net.NetworkStats.DEFAULT_NETWORK_ALL;
20 import static android.net.NetworkStats.DEFAULT_NETWORK_NO;
21 import static android.net.NetworkStats.DEFAULT_NETWORK_YES;
22 import static android.net.NetworkStats.IFACE_ALL;
23 import static android.net.NetworkStats.INTERFACES_ALL;
24 import static android.net.NetworkStats.METERED_ALL;
25 import static android.net.NetworkStats.METERED_NO;
26 import static android.net.NetworkStats.METERED_YES;
27 import static android.net.NetworkStats.ROAMING_ALL;
28 import static android.net.NetworkStats.ROAMING_NO;
[all …]
DNetworkStatsHistoryTest.java110 new NetworkStats.Entry(1024L, 10L, 2048L, 20L, 2L)); in testRecordSingleBucket()
124 new NetworkStats.Entry(1024L, 10L, 128L, 2L, 2L)); in testRecordEqualBuckets()
141 new NetworkStats.Entry(1000L, 2000L, 5000L, 10000L, 100L)); in testRecordTouchingBuckets()
161 new NetworkStats.Entry(128L, 2L, 256L, 4L, 1L)); in testRecordGapBuckets()
163 new NetworkStats.Entry(64L, 1L, 512L, 8L, 2L)); in testRecordGapBuckets()
174 new NetworkStats.Entry(2048L, 4L, 2048L, 4L, 2L)); in testRecordGapBuckets()
191 new NetworkStats.Entry(256L, 2L, 256L, 2L, 1L)); in testRecordOverlapBuckets()
194 new NetworkStats.Entry(1024L, 10L, 1024L, 10L, 10L)); in testRecordOverlapBuckets()
332 final NetworkStats.Entry entry = new NetworkStats.Entry(); in testFuzzing()
371 new NetworkStats.Entry(1024L, 10L, 2048L, 20L, 4L)); in testIgnoreFields()
[all …]
/frameworks/base/services/core/java/com/android/server/net/
DNetworkStatsFactory.java19 import static android.net.NetworkStats.INTERFACES_ALL;
20 import static android.net.NetworkStats.SET_ALL;
21 import static android.net.NetworkStats.TAG_ALL;
22 import static android.net.NetworkStats.TAG_NONE;
23 import static android.net.NetworkStats.UID_ALL;
29 import android.net.NetworkStats;
88 private NetworkStats mPersistSnapshot;
92 private NetworkStats mTunAnd464xlatAdjustedStats;
132 if (requiredIfaces == NetworkStats.INTERFACES_ALL) { in augmentWithStackedInterfaces()
157 public void apply464xlatAdjustments(NetworkStats baseTraffic, NetworkStats stackedTraffic) { in apply464xlatAdjustments()
[all …]
DNetworkStatsService.java32 import static android.net.NetworkStats.DEFAULT_NETWORK_ALL;
33 import static android.net.NetworkStats.IFACE_ALL;
34 import static android.net.NetworkStats.IFACE_VT;
35 import static android.net.NetworkStats.INTERFACES_ALL;
36 import static android.net.NetworkStats.METERED_ALL;
37 import static android.net.NetworkStats.ROAMING_ALL;
38 import static android.net.NetworkStats.SET_ALL;
39 import static android.net.NetworkStats.SET_DEFAULT;
40 import static android.net.NetworkStats.SET_FOREGROUND;
41 import static android.net.NetworkStats.STATS_PER_IFACE;
[all …]
DNetworkStatsCollection.java19 import static android.net.NetworkStats.DEFAULT_NETWORK_NO;
20 import static android.net.NetworkStats.DEFAULT_NETWORK_YES;
21 import static android.net.NetworkStats.IFACE_ALL;
22 import static android.net.NetworkStats.METERED_NO;
23 import static android.net.NetworkStats.METERED_YES;
24 import static android.net.NetworkStats.ROAMING_NO;
25 import static android.net.NetworkStats.ROAMING_YES;
26 import static android.net.NetworkStats.SET_ALL;
27 import static android.net.NetworkStats.SET_DEFAULT;
28 import static android.net.NetworkStats.TAG_NONE;
[all …]
/frameworks/base/tests/net/java/com/android/server/net/
DNetworkStatsBaseTest.java19 import static android.net.NetworkStats.DEFAULT_NETWORK_ALL;
20 import static android.net.NetworkStats.DEFAULT_NETWORK_NO;
21 import static android.net.NetworkStats.DEFAULT_NETWORK_YES;
22 import static android.net.NetworkStats.METERED_ALL;
23 import static android.net.NetworkStats.METERED_NO;
24 import static android.net.NetworkStats.METERED_YES;
25 import static android.net.NetworkStats.ROAMING_ALL;
26 import static android.net.NetworkStats.ROAMING_NO;
27 import static android.net.NetworkStats.ROAMING_YES;
28 import static android.net.NetworkStats.SET_ALL;
[all …]
DNetworkStatsServiceTest.java25 import static android.net.NetworkStats.DEFAULT_NETWORK_ALL;
26 import static android.net.NetworkStats.DEFAULT_NETWORK_YES;
27 import static android.net.NetworkStats.IFACE_ALL;
28 import static android.net.NetworkStats.INTERFACES_ALL;
29 import static android.net.NetworkStats.METERED_ALL;
30 import static android.net.NetworkStats.METERED_NO;
31 import static android.net.NetworkStats.METERED_YES;
32 import static android.net.NetworkStats.ROAMING_ALL;
33 import static android.net.NetworkStats.ROAMING_NO;
34 import static android.net.NetworkStats.ROAMING_YES;
[all …]
DNetworkStatsFactoryTest.java19 import static android.net.NetworkStats.DEFAULT_NETWORK_ALL;
20 import static android.net.NetworkStats.DEFAULT_NETWORK_NO;
21 import static android.net.NetworkStats.METERED_ALL;
22 import static android.net.NetworkStats.METERED_NO;
23 import static android.net.NetworkStats.ROAMING_ALL;
24 import static android.net.NetworkStats.ROAMING_NO;
25 import static android.net.NetworkStats.SET_ALL;
26 import static android.net.NetworkStats.SET_DEFAULT;
27 import static android.net.NetworkStats.SET_FOREGROUND;
28 import static android.net.NetworkStats.TAG_NONE;
[all …]
DNetworkStatsObserversTest.java20 import static android.net.NetworkStats.DEFAULT_NETWORK_NO;
21 import static android.net.NetworkStats.DEFAULT_NETWORK_YES;
22 import static android.net.NetworkStats.METERED_NO;
23 import static android.net.NetworkStats.ROAMING_NO;
24 import static android.net.NetworkStats.SET_DEFAULT;
25 import static android.net.NetworkStats.TAG_NONE;
39 import android.net.NetworkStats;
242 NetworkStats xtSnapshot = new NetworkStats(TEST_START, 1 /* initialSize */) in testUpdateStats_initialSample_doesNotNotify()
244 NetworkStats uidSnapshot = null; in testUpdateStats_initialSample_doesNotNotify()
266 NetworkStats xtSnapshot = new NetworkStats(TEST_START, 1 /* initialSize */) in testUpdateStats_belowThreshold_doesNotNotify()
[all …]
/frameworks/base/core/java/android/app/usage/
DNetworkStats.java39 public final class NetworkStats implements AutoCloseable { class
68 private int mTag = android.net.NetworkStats.TAG_NONE;
85 private android.net.NetworkStats mSummary = null;
100 private android.net.NetworkStats.Entry mRecycledSummaryEntry = null;
104 NetworkStats(Context context, NetworkTemplate template, int flags, long startTimestamp, in NetworkStats() method in NetworkStats
161 public static final int UID_ALL = android.net.NetworkStats.UID_ALL;
266 public static final int TAG_NONE = android.net.NetworkStats.TAG_NONE;
283 case STATE_ALL: return android.net.NetworkStats.SET_ALL; in convertSet()
284 case STATE_DEFAULT: return android.net.NetworkStats.SET_DEFAULT; in convertSet()
285 case STATE_FOREGROUND: return android.net.NetworkStats.SET_FOREGROUND; in convertSet()
[all …]
DNetworkStatsManager.java25 import android.app.usage.NetworkStats.Bucket;
178 NetworkStats stats = new NetworkStats(mContext, template, mFlags, startTime, endTime, in querySummaryForDevice()
251 NetworkStats stats; in querySummaryForUser()
252 stats = new NetworkStats(mContext, template, mFlags, startTime, endTime, mService); in querySummaryForUser()
278 public NetworkStats querySummary(int networkType, String subscriberId, long startTime, in querySummary()
292 public NetworkStats querySummary(NetworkTemplate template, long startTime, in querySummary()
294 NetworkStats result; in querySummary()
295 result = new NetworkStats(mContext, template, mFlags, startTime, endTime, mService); in querySummary()
306 public NetworkStats queryDetailsForUid(int networkType, String subscriberId, in queryDetailsForUid()
309 NetworkStats.Bucket.TAG_NONE, NetworkStats.Bucket.STATE_ALL); in queryDetailsForUid()
[all …]
/frameworks/base/tests/net/java/android/app/usage/
DNetworkStatsManagerTest.java36 import android.net.NetworkStats.Entry;
80 android.net.NetworkStats.SET_DEFAULT, android.net.NetworkStats.TAG_NONE, in testQueryDetails()
85 android.net.NetworkStats.SET_DEFAULT, android.net.NetworkStats.TAG_NONE, in testQueryDetails()
89 android.net.NetworkStats.SET_DEFAULT, android.net.NetworkStats.TAG_NONE, in testQueryDetails()
94 android.net.NetworkStats.SET_DEFAULT, android.net.NetworkStats.TAG_NONE, in testQueryDetails()
110 eq(uid1), eq(android.net.NetworkStats.SET_ALL), in testQueryDetails()
111 eq(android.net.NetworkStats.TAG_NONE), in testQueryDetails()
121 eq(uid2), eq(android.net.NetworkStats.SET_ALL), in testQueryDetails()
122 eq(android.net.NetworkStats.TAG_NONE), in testQueryDetails()
132 NetworkStats stats = mManager.queryDetails( in testQueryDetails()
[all …]
/frameworks/base/tests/net/common/java/android/net/netstats/
DNetworkStatsApiTest.kt19 import android.net.NetworkStats
20 import android.net.NetworkStats.DEFAULT_NETWORK_NO
21 import android.net.NetworkStats.DEFAULT_NETWORK_YES
22 import android.net.NetworkStats.Entry
23 import android.net.NetworkStats.IFACE_VT
24 import android.net.NetworkStats.METERED_NO
25 import android.net.NetworkStats.METERED_YES
26 import android.net.NetworkStats.ROAMING_NO
27 import android.net.NetworkStats.ROAMING_YES
28 import android.net.NetworkStats.SET_DEFAULT
[all …]
/frameworks/base/core/tests/bandwidthtests/src/com/android/bandwidthtest/
DBandwidthTest.java23 import android.net.NetworkStats;
24 import android.net.NetworkStats.Entry;
119 NetworkStats pre_test_stats = fetchDataFromProc(mUid); in downloadFile()
127 NetworkStats prof_stats = TrafficStats.stopDataProfiling(mContext); in downloadFile()
130 NetworkStats post_test_stats = fetchDataFromProc(mUid); in downloadFile()
131 NetworkStats proc_stats = post_test_stats.subtract(pre_test_stats); in downloadFile()
179 NetworkStats pre_test_stats = fetchDataFromProc(mUid); in uploadFile()
182 NetworkStats prof_stats = TrafficStats.stopDataProfiling(mContext); in uploadFile()
184 NetworkStats post_test_stats = fetchDataFromProc(mUid); in uploadFile()
185 NetworkStats proc_stats = post_test_stats.subtract(pre_test_stats); in uploadFile()
[all …]
/frameworks/libs/net/common/devicetests/com/android/testutils/
DNetworkStatsUtils.kt19 import android.net.NetworkStats in <lambda>()
24 leftStats: NetworkStats, in <lambda>()
25 rightStats: NetworkStats, in <lambda>()
41 val left = NetworkStats.Entry() in <lambda>()
42 val right = NetworkStats.Entry() in <lambda>()
64 expected: NetworkStats, in assertNetworkStatsEquals()
65 actual: NetworkStats, in assertNetworkStatsEquals()
76 fun assertParcelingIsLossless(stats: NetworkStats) { in assertParcelingIsLossless()
DTestableNetworkStatsProviderCbBinder.kt19 import android.net.NetworkStats
32 val ifaceStats: NetworkStats,
33 val uidStats: NetworkStats
42 override fun notifyStatsUpdated(token: Int, ifaceStats: NetworkStats, uidStats: NetworkStats) { in notifyStatsUpdated()
63 fun expectNotifyStatsUpdated(ifaceStats: NetworkStats, uidStats: NetworkStats) { in expectNotifyStatsUpdated()
/frameworks/base/core/tests/benchmarks/src/android/net/
DNetworkStatsBenchmark.java38 private NetworkStats mNetworkStats;
42 mNetworkStats = new NetworkStats(0, mSize + 2); in setUp()
44 NetworkStats.Entry recycle = new NetworkStats.Entry(); in setUp()
51 recycle.tag = NetworkStats.TAG_NONE; in setUp()
66 recycle.set = NetworkStats.SET_FOREGROUND; in setUp()
67 recycle.tag = NetworkStats.TAG_NONE; in setUp()
93 NetworkStats stats = mNetworkStats.clone(); in timeMigrateTun()
105 NetworkStats stats = mNetworkStats.clone(); in timeClone()
/frameworks/base/core/java/android/net/
DNetworkStats.java55 public final class NetworkStats implements Parcelable { class
433 public NetworkStats(long elapsedRealtime, int initialSize) { in NetworkStats() method in NetworkStats
458 public NetworkStats(Parcel parcel) { in NetworkStats() method in NetworkStats
499 public NetworkStats clone() { in clone()
500 final NetworkStats clone = new NetworkStats(elapsedRealtime, size); in clone()
501 NetworkStats.Entry entry = null; in clone()
531 public NetworkStats insertEntry( in insertEntry()
539 public NetworkStats insertEntry(String iface, int uid, int set, int tag, long rxBytes, in insertEntry()
547 public NetworkStats insertEntry(String iface, int uid, int set, int tag, int metered, in insertEntry()
560 public NetworkStats insertEntry(Entry entry) { in insertEntry()
[all …]
DINetworkStatsSession.aidl19 import android.net.NetworkStats;
27 NetworkStats getDeviceSummaryForNetwork(in NetworkTemplate template, long start, long end); in getDeviceSummaryForNetwork()
31 NetworkStats getSummaryForNetwork(in NetworkTemplate template, long start, long end); in getSummaryForNetwork()
38NetworkStats getSummaryForAllUid(in NetworkTemplate template, long start, long end, boolean includ… in getSummaryForAllUid()
/frameworks/base/tests/benchmarks/src/com/android/server/net/
DNetworkStatsFactoryBenchmark.java19 import android.net.NetworkStats;
43 NetworkStatsFactory.javaReadNetworkStatsDetail(mStats, NetworkStats.UID_ALL, in timeReadNetworkStatsDetailJava()
52 final NetworkStats stats = new NetworkStats(SystemClock.elapsedRealtime(), 0); in timeReadNetworkStatsDetailNative()
54 stats, mStats.getAbsolutePath(), NetworkStats.UID_ALL, in timeReadNetworkStatsDetailNative()
/frameworks/base/packages/Tethering/src/com/android/networkstack/tethering/
DBpfCoordinator.java19 import static android.net.NetworkStats.DEFAULT_NETWORK_NO;
20 import static android.net.NetworkStats.METERED_NO;
21 import static android.net.NetworkStats.ROAMING_NO;
22 import static android.net.NetworkStats.SET_DEFAULT;
23 import static android.net.NetworkStats.TAG_NONE;
24 import static android.net.NetworkStats.UID_ALL;
25 import static android.net.NetworkStats.UID_TETHERING;
33 import android.net.NetworkStats;
34 import android.net.NetworkStats.Entry;
528 private NetworkStats mIfaceStats = new NetworkStats(0L, 0);
[all …]
DOffloadController.java19 import static android.net.NetworkStats.DEFAULT_NETWORK_NO;
20 import static android.net.NetworkStats.METERED_NO;
21 import static android.net.NetworkStats.ROAMING_NO;
22 import static android.net.NetworkStats.SET_DEFAULT;
23 import static android.net.NetworkStats.TAG_NONE;
24 import static android.net.NetworkStats.UID_ALL;
25 import static android.net.NetworkStats.UID_TETHERING;
39 import android.net.NetworkStats;
40 import android.net.NetworkStats.Entry;
297 private NetworkStats mIfaceStats = new NetworkStats(0L, 0);
[all …]
/frameworks/base/packages/Tethering/tests/unit/src/com/android/networkstack/tethering/
DBpfCoordinatorTest.java19 import static android.net.NetworkStats.DEFAULT_NETWORK_NO;
20 import static android.net.NetworkStats.METERED_NO;
21 import static android.net.NetworkStats.ROAMING_NO;
22 import static android.net.NetworkStats.SET_DEFAULT;
23 import static android.net.NetworkStats.TAG_NONE;
24 import static android.net.NetworkStats.UID_ALL;
25 import static android.net.NetworkStats.UID_TETHERING;
52 import android.net.NetworkStats;
161 private static NetworkStats.Entry buildTestEntry(@NonNull StatsType how, in buildTestEntry()
163 return new NetworkStats.Entry(iface, how == STATS_PER_IFACE ? UID_ALL : UID_TETHERING, in buildTestEntry()
[all …]
/frameworks/base/core/java/android/net/netstats/provider/
DINetworkStatsProviderCallback.aidl19 import android.net.NetworkStats;
27 void notifyStatsUpdated(int token, in NetworkStats ifaceStats, in NetworkStats uidStats); in notifyStatsUpdated()
/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/net/
DDataUsageControllerTest.java31 import android.app.usage.NetworkStats;
107 .thenReturn(mock(NetworkStats.Bucket.class)); in getHistoricalUsageLevel_noUsageData_shouldReturn0()
116 final NetworkStats.Bucket bucket = mock(NetworkStats.Bucket.class); in getHistoricalUsageLevel_hasUsageData_shouldReturnTotalUsage()
132 final NetworkStats.Bucket defaultSubscriberBucket = mock(NetworkStats.Bucket.class); in getDataUsageInfo_hasUsageData_shouldReturnCorrectUsageForExplicitSubId()
141 final NetworkStats.Bucket nonDefaultSubscriberBucket = mock(NetworkStats.Bucket.class); in getDataUsageInfo_hasUsageData_shouldReturnCorrectUsageForExplicitSubId()

123