NetworkStatsManager.QueryDetailsForUid 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
查詢特定 UI 的網路使用統計資料。
[Android.Runtime.Register("queryDetailsForUid", "(ILjava/lang/String;JJI)Landroid/app/usage/NetworkStats;", "GetQueryDetailsForUid_ILjava_lang_String_JJIHandler", ApiSince=23)]
public virtual Android.App.Usage.NetworkStats QueryDetailsForUid(Android.Net.ConnectivityType networkType, string? subscriberId, long startTime, long endTime, int uid);
[<Android.Runtime.Register("queryDetailsForUid", "(ILjava/lang/String;JJI)Landroid/app/usage/NetworkStats;", "GetQueryDetailsForUid_ILjava_lang_String_JJIHandler", ApiSince=23)>]
abstract member QueryDetailsForUid : Android.Net.ConnectivityType * string * int64 * int64 * int -> Android.App.Usage.NetworkStats
override this.QueryDetailsForUid : Android.Net.ConnectivityType * string * int64 * int64 * int -> Android.App.Usage.NetworkStats
參數
- networkType
- ConnectivityType
如定義於 ConnectivityManager,例如 ConnectivityManager#TYPE_MOBILE, ConnectivityManager#TYPE_WIFI 等等。
- subscriberId
- String
如適用,請提供網路介面的用戶 ID。
<p>從 API 等級 29 開始,受到 subscriberId 額外的限制保護。 呼叫不符合新存取需求的 subscriberId 應用程式,可以在查詢行動網路類型時提供 null 一個值,以接收所有行動網路的使用情況。 更多細節請參見 TelephonyManager#getSubscriberId()。
<p>從 API 等級 31 開始,呼叫應用程式可以提供 subscriberId 一種 WiFi 網路類型,以接收 WiFi 網路的使用量,若適用,則屬於該訂閱。
否則,查詢所有 WiFi 網路時就不 null 行。
- startTime
- Int64
課堂開始。 以「Unix 時間」定義,請參見 java.lang.System#currentTimeMillis。
- endTime
- Int64
課程結束。 以「Unix 時間」定義,請參見 java.lang.System#currentTimeMillis。
- uid
- Int32
應用程式的 UID
傳回
上述統計數據。
- 屬性
備註
查詢特定 UI 的網路使用統計資料。 這可能需要很長時間,應用程式應避免在主串中呼叫此訊息。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。