Package org.robolectric.shadows
Class ShadowTrafficStats
java.lang.Object
org.robolectric.shadows.ShadowTrafficStats
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidprotected static longprotected static longprotected static longprotected static longprotected static intprotected static longprotected static longprotected static longprotected static longprotected static longgetUidRxBytes(int i) protected static longgetUidRxPackets(int i) protected static longgetUidTcpRxBytes(int i) protected static longgetUidTcpRxSegments(int i) protected static longgetUidTcpTxBytes(int i) protected static longgetUidTcpTxSegments(int i) protected static longgetUidTxBytes(int i) protected static longgetUidTxPackets(int i) protected static longgetUidUdpRxBytes(int i) protected static longgetUidUdpRxPackets(int i) protected static longgetUidUdpTxBytes(int i) protected static longgetUidUdpTxPackets(int i) protected static voidincrementOperationCount(int operationCount) protected static voidincrementOperationCount(int tag, int operationCount) static voidUpdates all non UID specific fields back toTrafficStats.UNSUPPORTEDstatic voidsetMobileRxBytes(int mobileRxBytes) Sets the value returned bygetMobileRxBytes()for testingstatic voidsetMobileRxPackets(int mobileRxPackets) Sets the value returned bygetMobileRxPackets()for testingstatic voidsetMobileTxBytes(int mobileTxBytes) Sets the value returned bygetMobileTxBytes()for testingstatic voidsetMobileTxPackets(int mobileTxPackets) Sets the value returned bygetMobileTxPackets()for testingprotected static voidsetThreadStatsTag(int tag) static voidsetTotalRxBytes(int totalRxBytes) Sets the value returned bygetTotalRxBytes()for testingstatic voidsetTotalRxPackets(int totalRxPackets) Sets the value returned bygetTotalRxPackets()for testingstatic voidsetTotalTxBytes(int totalTxBytes) Sets the value returned bygetTotalTxBytes()for testingstatic voidsetTotalTxPackets(int totalTxPackets) Sets the value returned bygetTotalTxPackets()for testingprotected static voidtagDatagramSocket(DatagramSocket socket) No-op in tests.protected static voidprotected static voiduntagSocket(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
-