NetworkStatsManager.QueryDetailsForUidTagState Method

Definition

Query network usage statistics details for a given uid, tag, and state.

[Android.Runtime.Register("queryDetailsForUidTagState", "(ILjava/lang/String;JJIII)Landroid/app/usage/NetworkStats;", "GetQueryDetailsForUidTagState_ILjava_lang_String_JJIIIHandler", ApiSince=28)]
public virtual Android.App.Usage.NetworkStats QueryDetailsForUidTagState (Android.Net.ConnectivityType networkType, string? subscriberId, long startTime, long endTime, int uid, int tag, Android.App.Usage.NetworkUsageState state);
[<Android.Runtime.Register("queryDetailsForUidTagState", "(ILjava/lang/String;JJIII)Landroid/app/usage/NetworkStats;", "GetQueryDetailsForUidTagState_ILjava_lang_String_JJIIIHandler", ApiSince=28)>]
abstract member QueryDetailsForUidTagState : Android.Net.ConnectivityType * string * int64 * int64 * int * int * Android.App.Usage.NetworkUsageState -> Android.App.Usage.NetworkStats
override this.QueryDetailsForUidTagState : Android.Net.ConnectivityType * string * int64 * int64 * int * int * Android.App.Usage.NetworkUsageState -> Android.App.Usage.NetworkStats

Parameters

networkType
ConnectivityType

As defined in ConnectivityManager, e.g. ConnectivityManager#TYPE_MOBILE, ConnectivityManager#TYPE_WIFI etc.

subscriberId
String

If applicable, the subscriber id of the network interface. <p>Starting with API level 29, the subscriberId is guarded by additional restrictions. Calling apps that do not meet the new requirements to access the subscriberId can provide a null value when querying for the mobile network type to receive usage for all mobile networks. For additional details see TelephonyManager#getSubscriberId(). <p>Starting with API level 31, calling apps can provide a subscriberId with wifi network type to receive usage for wifi networks which is under the given subscription if applicable. Otherwise, pass null when querying all wifi networks.

startTime
Int64

Start of period. Defined in terms of "Unix time", see java.lang.System#currentTimeMillis.

endTime
Int64

End of period. Defined in terms of "Unix time", see java.lang.System#currentTimeMillis.

uid
Int32

UID of app

tag
Int32

TAG of interest. Use NetworkStats.Bucket#TAG_NONE for no tags.

state
NetworkUsageState

state of interest. Use NetworkStats.Bucket#STATE_ALL to aggregate traffic from all states.

Returns

Statistics object or null if an error happened during statistics collection.

Attributes

Remarks

Java documentation for android.app.usage.NetworkStatsManager.queryDetailsForUidTagState(int, java.lang.String, long, long, int, int, 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