Methods Summary |
---|
public static void | clearThreadStatsTag()Clear active tag used when accounting {@link Socket} traffic originating
from the current thread.
if (Build.VERSION.SDK_INT >= 14) {
IMPL = new IcsTrafficStatsCompatImpl();
} else {
IMPL = new BaseTrafficStatsCompatImpl();
}
IMPL.clearThreadStatsTag();
|
public static int | getThreadStatsTag()Get the active tag used when accounting {@link Socket} traffic originating
from the current thread. Only one active tag per thread is supported.
{@link #tagSocket(Socket)}.
return IMPL.getThreadStatsTag();
|
public static void | incrementOperationCount(int operationCount)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.
IMPL.incrementOperationCount(operationCount);
|
public static void | incrementOperationCount(int tag, int operationCount)Increment count of network operations performed under the given
accounting tag. This can be used to derive bytes-per-operation.
IMPL.incrementOperationCount(tag, operationCount);
|
public static void | setThreadStatsTag(int tag)Set active tag to use when accounting {@link Socket} traffic originating
from the current thread. Only one active tag per thread is supported.
Changes only take effect during subsequent calls to
{@link #tagSocket(Socket)}.
Tags between {@code 0xFFFFFF00} and {@code 0xFFFFFFFF} are reserved and
used internally by system services like DownloadManager when performing
traffic on behalf of an application.
IMPL.setThreadStatsTag(tag);
|
public static void | tagSocket(java.net.Socket socket)Tag the given {@link Socket} with any statistics parameters active for
the current thread. Subsequent calls always replace any existing
parameters. When finished, call {@link #untagSocket(Socket)} to remove
statistics parameters.
IMPL.tagSocket(socket);
|
public static void | untagSocket(java.net.Socket socket)Remove any statistics parameters from the given {@link Socket}.
IMPL.untagSocket(socket);
|