Package org.robolectric.shadows
Class ShadowTrafficStats
- java.lang.Object
-
- org.robolectric.shadows.ShadowTrafficStats
-
@Implements(android.net.TrafficStats.class) public class ShadowTrafficStats extends Object
-
-
Constructor Summary
Constructors Constructor Description ShadowTrafficStats()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static voidclearThreadStatsTag()protected static longgetMobileRxBytes()protected static longgetMobileRxPackets()protected static longgetMobileTxBytes()protected static longgetMobileTxPackets()protected static intgetThreadStatsTag()protected static longgetTotalRxBytes()protected static longgetTotalRxPackets()protected static longgetTotalTxBytes()protected static longgetTotalTxPackets()protected 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 voidrestoreDefaults()Updates 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 voidtagSocket(Socket socket)protected static voiduntagSocket(Socket socket)
-
-
-
Method Detail
-
setThreadStatsTag
@Implementation protected static void setThreadStatsTag(int tag)
-
getThreadStatsTag
@Implementation protected static int getThreadStatsTag()
-
clearThreadStatsTag
@Implementation protected static void clearThreadStatsTag()
-
tagSocket
@Implementation protected static void tagSocket(Socket socket) throws SocketException
- Throws:
SocketException
-
tagDatagramSocket
@Implementation(minSdk=24) protected static void tagDatagramSocket(DatagramSocket socket) throws SocketException
No-op in tests.- Throws:
SocketException
-
untagSocket
@Implementation protected static void untagSocket(Socket socket) throws SocketException
- Throws:
SocketException
-
incrementOperationCount
@Implementation protected static void incrementOperationCount(int operationCount)
-
incrementOperationCount
@Implementation protected static void incrementOperationCount(int tag, int operationCount)
-
getMobileTxPackets
@Implementation protected static long getMobileTxPackets()
-
getMobileRxPackets
@Implementation protected static long getMobileRxPackets()
-
getMobileTxBytes
@Implementation protected static long getMobileTxBytes()
-
getMobileRxBytes
@Implementation protected static long getMobileRxBytes()
-
getTotalTxPackets
@Implementation protected static long getTotalTxPackets()
-
getTotalRxPackets
@Implementation protected static long getTotalRxPackets()
-
getTotalTxBytes
@Implementation protected static long getTotalTxBytes()
-
getTotalRxBytes
@Implementation protected static long getTotalRxBytes()
-
getUidTxBytes
@Implementation protected static long getUidTxBytes(int i)
-
getUidRxBytes
@Implementation protected static long getUidRxBytes(int i)
-
getUidTxPackets
@Implementation protected static long getUidTxPackets(int i)
-
getUidRxPackets
@Implementation protected static long getUidRxPackets(int i)
-
getUidTcpTxBytes
@Implementation protected static long getUidTcpTxBytes(int i)
-
getUidTcpRxBytes
@Implementation protected static long getUidTcpRxBytes(int i)
-
getUidUdpTxBytes
@Implementation protected static long getUidUdpTxBytes(int i)
-
getUidUdpRxBytes
@Implementation protected static long getUidUdpRxBytes(int i)
-
getUidTcpTxSegments
@Implementation protected static long getUidTcpTxSegments(int i)
-
getUidTcpRxSegments
@Implementation protected static long getUidTcpRxSegments(int i)
-
getUidUdpTxPackets
@Implementation protected static long getUidUdpTxPackets(int i)
-
getUidUdpRxPackets
@Implementation protected static long getUidUdpRxPackets(int i)
-
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
@Resetter public static void restoreDefaults()
Updates all non UID specific fields back toTrafficStats.UNSUPPORTED
-
-