TrafficStatsCompat
class TrafficStatsCompat
Helper for accessing features in TrafficStats.
Summary
Public functions |
|
|---|---|
java-static Unit |
This function is deprecated. Use |
java-static Int |
This function is deprecated. Use |
java-static Unit |
This function is deprecated. Use |
java-static Unit |
This function is deprecated. Use |
java-static Unit |
This function is deprecated. Use |
java-static Unit |
tagDatagramSocket(socket: DatagramSocket)Tag the given |
java-static Unit |
This function is deprecated. Use |
java-static Unit |
untagDatagramSocket(socket: DatagramSocket)Remove any statistics parameters from the given |
java-static Unit |
This function is deprecated. Use |
Public functions
java-static funclearThreadStatsTag(): Unit
Clear active tag used when accounting Socket traffic originating from the current thread.
java-static fungetThreadStatsTag(): Int
Get the active tag used when accounting Socket traffic originating from the current thread. Only one active tag per thread is supported. tagSocket.
java-static funincrementOperationCount(operationCount: Int): Unit
Increment count of network operations performed under the accounting tag currently active on the calling thread. This can be used to derive bytes-per-operation.
| Parameters | |
|---|---|
operationCount: Int |
Number of operations to increment count by. |
java-static funincrementOperationCount(tag: Int, operationCount: Int): Unit
Increment count of network operations performed under the given accounting tag. This can be used to derive bytes-per-operation.
| Parameters | |
|---|---|
tag: Int |
Accounting tag used in |
operationCount: Int |
Number of operations to increment count by. |
java-static funsetThreadStatsTag(tag: Int): Unit
Set active tag to use when accounting Socket traffic originating from the current thread. Only one active tag per thread is supported.
Changes only take effect during subsequent calls to tagSocket.
Tags between 0xFFFFFF00 and 0xFFFFFFFF are reserved and used internally by system services like DownloadManager when performing traffic on behalf of an application.
tagDatagramSocket
java-static fun tagDatagramSocket(socket: DatagramSocket): Unit
Tag the given DatagramSocket with any statistics parameters active for the current thread. Subsequent calls always replace any existing parameters. When finished, call untagDatagramSocket to remove statistics parameters.
| Throws | |
|---|---|
java.net.SocketException |
| See also | |
|---|---|
setThreadStatsTag |
java-static funtagSocket(socket: Socket!): Unit
Tag the given Socket with any statistics parameters active for the current thread. Subsequent calls always replace any existing parameters. When finished, call untagSocket to remove statistics parameters.
| Throws | |
|---|---|
java.net.SocketException |
| See also | |
|---|---|
setThreadStatsTag |
untagDatagramSocket
java-static fun untagDatagramSocket(socket: DatagramSocket): Unit
Remove any statistics parameters from the given DatagramSocket.
| Throws | |
|---|---|
java.net.SocketException |
java-static fununtagSocket(socket: Socket!): Unit
Remove any statistics parameters from the given Socket.
| Throws | |
|---|---|
java.net.SocketException |