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 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 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
tagSocket(Socket socket)
protected static void
untagSocket(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
-
-