TrafficStatsCompat

Added in 1.1.0

class TrafficStatsCompat


Helper for accessing features in TrafficStats.

Summary

Public functions

java-static Unit

This function is deprecated.

Use clearThreadStatsTag directly.

java-static Int

This function is deprecated.

Use getThreadStatsTag directly.

java-static Unit
incrementOperationCount(operationCount: Int)

This function is deprecated.

Use incrementOperationCount directly.

java-static Unit
incrementOperationCount(tag: Int, operationCount: Int)

This function is deprecated.

Use incrementOperationCount directly.

java-static Unit

This function is deprecated.

Use setThreadStatsTag directly.

java-static Unit

Tag the given DatagramSocket with any statistics parameters active for the current thread.

java-static Unit
tagSocket(socket: Socket!)

This function is deprecated.

Use tagSocket directly.

java-static Unit

Remove any statistics parameters from the given DatagramSocket.

java-static Unit
untagSocket(socket: Socket!)

This function is deprecated.

Use untagSocket directly.

Public functions

clearThreadStatsTag

Added in 1.1.0
Deprecated in 1.1.0
java-static fun clearThreadStatsTag(): Unit

Clear active tag used when accounting Socket traffic originating from the current thread.

getThreadStatsTag

Added in 1.1.0
Deprecated in 1.1.0
java-static fun getThreadStatsTag(): Int

Get the active tag used when accounting Socket traffic originating from the current thread. Only one active tag per thread is supported. tagSocket.

incrementOperationCount

Added in 1.1.0
Deprecated in 1.1.0
java-static fun incrementOperationCount(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.

incrementOperationCount

Added in 1.1.0
Deprecated in 1.1.0
java-static fun incrementOperationCount(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 setThreadStatsTag.

operationCount: Int

Number of operations to increment count by.

setThreadStatsTag

Added in 1.1.0
Deprecated in 1.1.0
java-static fun setThreadStatsTag(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

Added in 1.1.0
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.

tagSocket

Added in 1.1.0
Deprecated in 1.1.0
java-static fun tagSocket(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.

untagDatagramSocket

Added in 1.1.0
java-static fun untagDatagramSocket(socket: DatagramSocket): Unit

Remove any statistics parameters from the given DatagramSocket.

untagSocket

Added in 1.1.0
Deprecated in 1.1.0
java-static fun untagSocket(socket: Socket!): Unit

Remove any statistics parameters from the given Socket.