Partager via


TrafficStats.ThreadStatsUid Property

Definition

Get the active UID used when accounting Socket traffic originating from the current thread. -or- Set specific UID to use when accounting Socket traffic originating from the current thread.

public static int ThreadStatsUid { [Android.Runtime.Register("getThreadStatsUid", "()I", "", ApiSince=28)] get; [Android.Runtime.Register("setThreadStatsUid", "(I)V", "", ApiSince=28)] set; }
[<get: Android.Runtime.Register("getThreadStatsUid", "()I", "", ApiSince=28)>]
[<set: Android.Runtime.Register("setThreadStatsUid", "(I)V", "", ApiSince=28)>]
static member ThreadStatsUid : int with get, set

Property Value

Attributes

Remarks

Property getter documentation:

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

Java documentation for android.net.TrafficStats.getThreadStatsUid().

Property setter documentation:

Set specific UID to use when accounting Socket traffic originating from the current thread. Designed for use when performing an operation on behalf of another application, or when another application is performing operations on your behalf.

Any app can <em>accept</em> blame for traffic performed on a socket originally created by another app by calling this method with the android.system.Os#getuid() value. However, only apps holding the android.Manifest.permission#UPDATE_DEVICE_STATS permission may <em>assign</em> blame to another UIDs.

Changes only take effect during subsequent calls to #tagSocket(Socket).

Java documentation for android.net.TrafficStats.setThreadStatsUid(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to