Package org.robolectric.shadows
Class ShadowTrafficStats
java.lang.Object
org.robolectric.shadows.ShadowTrafficStats
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static void
protected static long
protected static long
protected static long
protected static long
protected static int
protected static long
protected static long
protected static long
protected static long
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
Updates all non UID specific fields back toTrafficStats.UNSUPPORTED
static void
setMobileRxBytes
(int mobileRxBytes) Sets the value returned bygetMobileRxBytes()
for testingstatic void
setMobileRxPackets
(int mobileRxPackets) Sets the value returned bygetMobileRxPackets()
for testingstatic void
setMobileTxBytes
(int mobileTxBytes) Sets the value returned bygetMobileTxBytes()
for testingstatic void
setMobileTxPackets
(int mobileTxPackets) Sets the value returned bygetMobileTxPackets()
for testingprotected static void
setThreadStatsTag
(int tag) static void
setTotalRxBytes
(int totalRxBytes) Sets the value returned bygetTotalRxBytes()
for testingstatic void
setTotalRxPackets
(int totalRxPackets) Sets the value returned bygetTotalRxPackets()
for testingstatic void
setTotalTxBytes
(int totalTxBytes) Sets the value returned bygetTotalTxBytes()
for testingstatic void
setTotalTxPackets
(int totalTxPackets) Sets the value returned bygetTotalTxPackets()
for testingprotected static void
tagDatagramSocket
(DatagramSocket socket) No-op in tests.protected static void
protected static void
untagSocket
(Socket socket)
-
Constructor Details
-
ShadowTrafficStats
public ShadowTrafficStats()
-
-
Method Details
-
setThreadStatsTag
-
getThreadStatsTag
-
clearThreadStatsTag
-
tagSocket
- Throws:
SocketException
-
tagDatagramSocket
@Implementation(minSdk=24) protected static void tagDatagramSocket(DatagramSocket socket) throws SocketException No-op in tests.- Throws:
SocketException
-
untagSocket
- Throws:
SocketException
-
incrementOperationCount
-
incrementOperationCount
-
getMobileTxPackets
-
getMobileRxPackets
-
getMobileTxBytes
-
getMobileRxBytes
-
getTotalTxPackets
-
getTotalRxPackets
-
getTotalTxBytes
-
getTotalRxBytes
-
getUidTxBytes
-
getUidRxBytes
-
getUidTxPackets
-
getUidRxPackets
-
getUidTcpTxBytes
-
getUidTcpRxBytes
-
getUidUdpTxBytes
-
getUidUdpRxBytes
-
getUidTcpTxSegments
-
getUidTcpRxSegments
-
getUidUdpTxPackets
-
getUidUdpRxPackets
-
setMobileTxPackets
public static void setMobileTxPackets(int mobileTxPackets) Sets the value returned bygetMobileTxPackets()
for testing -
setMobileRxPackets
public static void setMobileRxPackets(int mobileRxPackets) Sets the value returned bygetMobileRxPackets()
for testing -
setMobileTxBytes
public static void setMobileTxBytes(int mobileTxBytes) Sets the value returned bygetMobileTxBytes()
for testing -
setMobileRxBytes
public static void setMobileRxBytes(int mobileRxBytes) Sets the value returned bygetMobileRxBytes()
for testing -
setTotalTxPackets
public static void setTotalTxPackets(int totalTxPackets) Sets the value returned bygetTotalTxPackets()
for testing -
setTotalRxPackets
public static void setTotalRxPackets(int totalRxPackets) Sets the value returned bygetTotalRxPackets()
for testing -
setTotalTxBytes
public static void setTotalTxBytes(int totalTxBytes) Sets the value returned bygetTotalTxBytes()
for testing -
setTotalRxBytes
public static void setTotalRxBytes(int totalRxBytes) Sets the value returned bygetTotalRxBytes()
for testing -
restoreDefaults
Updates all non UID specific fields back toTrafficStats.UNSUPPORTED
-