@Implements(android.net.TrafficStats.class) public class ShadowTrafficStats extends Object
Constructor | Description |
---|---|
ShadowTrafficStats() |
Modifier and Type | Method | Description |
---|---|---|
protected static void |
clearThreadStatsTag() |
|
protected static long |
getMobileRxBytes() |
|
protected static long |
getMobileRxPackets() |
|
protected static long |
getMobileTxBytes() |
|
protected static long |
getMobileTxPackets() |
|
protected static int |
getThreadStatsTag() |
|
protected static long |
getTotalRxBytes() |
|
protected static long |
getTotalRxPackets() |
|
protected static long |
getTotalTxBytes() |
|
protected static long |
getTotalTxPackets() |
|
protected static long |
getUidRxBytes(int i) |
|
protected static long |
getUidRxPackets(int i) |
|
protected static long |
getUidTcpRxBytes(int i) |
|
protected static long |
getUidTcpRxSegments(int i) |
|
protected static long |
getUidTcpTxBytes(int i) |
|
protected static long |
getUidTcpTxSegments(int i) |
|
protected static long |
getUidTxBytes(int i) |
|
protected static long |
getUidTxPackets(int i) |
|
protected static long |
getUidUdpRxBytes(int i) |
|
protected static long |
getUidUdpRxPackets(int i) |
|
protected static long |
getUidUdpTxBytes(int i) |
|
protected static long |
getUidUdpTxPackets(int i) |
|
protected static void |
incrementOperationCount(int operationCount) |
|
protected static void |
incrementOperationCount(int tag,
int operationCount) |
|
static void |
restoreDefaults() |
Updates all non UID specific fields back to
TrafficStats.UNSUPPORTED |
static void |
setMobileRxBytes(int mobileRxBytes) |
Sets the value returned by
getMobileRxBytes() for testing |
static void |
setMobileRxPackets(int mobileRxPackets) |
Sets the value returned by
getMobileRxPackets() for testing |
static void |
setMobileTxBytes(int mobileTxBytes) |
Sets the value returned by
getMobileTxBytes() for testing |
static void |
setMobileTxPackets(int mobileTxPackets) |
Sets the value returned by
getMobileTxPackets() for testing |
protected static void |
setThreadStatsTag(int tag) |
|
static void |
setTotalRxBytes(int totalRxBytes) |
Sets the value returned by
getTotalRxBytes() for testing |
static void |
setTotalRxPackets(int totalRxPackets) |
Sets the value returned by
getTotalRxPackets() for testing |
static void |
setTotalTxBytes(int totalTxBytes) |
Sets the value returned by
getTotalTxBytes() for testing |
static void |
setTotalTxPackets(int totalTxPackets) |
Sets the value returned by
getTotalTxPackets() for testing |
protected static void |
tagDatagramSocket(DatagramSocket socket) |
No-op in tests.
|
protected static void |
tagSocket(Socket socket) |
|
protected static void |
untagSocket(Socket socket) |
@Implementation protected static void setThreadStatsTag(int tag)
@Implementation protected static int getThreadStatsTag()
@Implementation protected static void clearThreadStatsTag()
@Implementation protected static void tagSocket(Socket socket) throws SocketException
SocketException
@Implementation(minSdk=24) protected static void tagDatagramSocket(DatagramSocket socket) throws SocketException
SocketException
@Implementation protected static void untagSocket(Socket socket) throws SocketException
SocketException
@Implementation protected static void incrementOperationCount(int operationCount)
@Implementation protected static void incrementOperationCount(int tag, int operationCount)
@Implementation protected static long getMobileTxPackets()
@Implementation protected static long getMobileRxPackets()
@Implementation protected static long getMobileTxBytes()
@Implementation protected static long getMobileRxBytes()
@Implementation protected static long getTotalTxPackets()
@Implementation protected static long getTotalRxPackets()
@Implementation protected static long getTotalTxBytes()
@Implementation protected static long getTotalRxBytes()
@Implementation protected static long getUidTxBytes(int i)
@Implementation protected static long getUidRxBytes(int i)
@Implementation protected static long getUidTxPackets(int i)
@Implementation protected static long getUidRxPackets(int i)
@Implementation protected static long getUidTcpTxBytes(int i)
@Implementation protected static long getUidTcpRxBytes(int i)
@Implementation protected static long getUidUdpTxBytes(int i)
@Implementation protected static long getUidUdpRxBytes(int i)
@Implementation protected static long getUidTcpTxSegments(int i)
@Implementation protected static long getUidTcpRxSegments(int i)
@Implementation protected static long getUidUdpTxPackets(int i)
@Implementation protected static long getUidUdpRxPackets(int i)
public static void setMobileTxPackets(int mobileTxPackets)
getMobileTxPackets()
for testingpublic static void setMobileRxPackets(int mobileRxPackets)
getMobileRxPackets()
for testingpublic static void setMobileTxBytes(int mobileTxBytes)
getMobileTxBytes()
for testingpublic static void setMobileRxBytes(int mobileRxBytes)
getMobileRxBytes()
for testingpublic static void setTotalTxPackets(int totalTxPackets)
getTotalTxPackets()
for testingpublic static void setTotalRxPackets(int totalRxPackets)
getTotalRxPackets()
for testingpublic static void setTotalTxBytes(int totalTxBytes)
getTotalTxBytes()
for testingpublic static void setTotalRxBytes(int totalRxBytes)
getTotalRxBytes()
for testing@Resetter public static void restoreDefaults()
TrafficStats.UNSUPPORTED