Class of android.net · TrafficStats.java · Android's reference
public class TrafficStats
Network statistics: tags kept per thread, and counts the device doesn't keep (UNSUPPORTED), as on an emulator.
public static final long UNSUPPORTED = -1 sourcepublic TrafficStats() empty body sourcepublic static void setThreadStatsTag(int t) sourcepublic static int getAndSetThreadStatsTag(int t) sourcepublic static int getThreadStatsTag() sourcepublic static void clearThreadStatsTag() sourcepublic static void tagSocket(java.net.Socket socket) empty body sourcepublic static void untagSocket(java.net.Socket socket) empty body sourcepublic static void tagDatagramSocket(java.net.DatagramSocket socket) empty body sourcepublic static void untagDatagramSocket(java.net.DatagramSocket socket) empty body sourcepublic static void incrementOperationCount(int operationCount) empty body sourcepublic static void incrementOperationCount(int tag, int operationCount) empty body sourcepublic static long getMobileRxBytes() sourcepublic static long getMobileTxBytes() sourcepublic static long getTotalRxBytes() sourcepublic static long getTotalTxBytes() sourcepublic static long getUidRxBytes(int uid) sourcepublic static long getUidTxBytes(int uid) sourceMade from ScarletNX's Sail at 166ad3910f80. The framework is ScarletNX's (GPL-3.0-or-later); the parts that follow the Android Open Source Project's sources (Apache-2.0) say so in their files.