Share via


DelegatedAdminReceiver.OnNetworkLogsAvailable Method

Definition

Called each time a new batch of network logs can be retrieved.

[Android.Runtime.Register("onNetworkLogsAvailable", "(Landroid/content/Context;Landroid/content/Intent;JI)V", "GetOnNetworkLogsAvailable_Landroid_content_Context_Landroid_content_Intent_JIHandler", ApiSince=29)]
public virtual void OnNetworkLogsAvailable (Android.Content.Context context, Android.Content.Intent intent, long batchToken, int networkLogsCount);
[<Android.Runtime.Register("onNetworkLogsAvailable", "(Landroid/content/Context;Landroid/content/Intent;JI)V", "GetOnNetworkLogsAvailable_Landroid_content_Context_Landroid_content_Intent_JIHandler", ApiSince=29)>]
abstract member OnNetworkLogsAvailable : Android.Content.Context * Android.Content.Intent * int64 * int -> unit
override this.OnNetworkLogsAvailable : Android.Content.Context * Android.Content.Intent * int64 * int -> unit

Parameters

context
Context

The running context as per #onReceive.

intent
Intent

The received intent as per #onReceive.

batchToken
Int64

The token representing the current batch of network logs.

networkLogsCount
Int32

The total count of events in the current batch of network logs.

Attributes

Remarks

Called each time a new batch of network logs can be retrieved. This callback method will only ever be called when network logging is enabled. The logs can only be retrieved while network logging is enabled.

If a secondary user or profile is created, this callback won't be received until all users become affiliated again (even if network logging is enabled). It will also no longer be possible to retrieve the network logs batch with the most recent batchToken provided by this callback. See DevicePolicyManager#setAffiliationIds.

This callback is only applicable if the delegated app has DevicePolicyManager#DELEGATION_NETWORK_LOGGING capability. Additionally, it must declare an intent filter for DeviceAdminReceiver#ACTION_NETWORK_LOGS_AVAILABLE in the receiver's manifest in order to receive this callback. The default implementation simply throws UnsupportedOperationException.

This callback is triggered by a foreground broadcast and the app should ensure that any long-running work is not executed synchronously inside the callback.

Java documentation for android.app.admin.DelegatedAdminReceiver.onNetworkLogsAvailable(android.content.Context, android.content.Intent, long, 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