다음을 통해 공유


VpnManager.ActionVpnManagerEvent Field

Definition

Action sent in android.content.Intents to VpnManager clients when an event occurred.

[Android.Runtime.Register("ACTION_VPN_MANAGER_EVENT", ApiSince=33)]
public const string ActionVpnManagerEvent;
[<Android.Runtime.Register("ACTION_VPN_MANAGER_EVENT", ApiSince=33)>]
val mutable ActionVpnManagerEvent : string

Field Value

Attributes

Remarks

Action sent in android.content.Intents to VpnManager clients when an event occurred.

If the provisioning application declares a service handling this intent action, but is not already running, it will be started. Upon starting, the application is granted a short grace period to run in the background even while the device is idle to handle any potential failures. Applications requiring long-running actions triggered by one of these events should declare a foreground service to prevent being killed once the grace period expires.

This action will have a category of either #CATEGORY_EVENT_IKE_ERROR, #CATEGORY_EVENT_NETWORK_ERROR, or #CATEGORY_EVENT_DEACTIVATED_BY_USER, that the app can use to filter events it's interested in reacting to.

It will also contain the following extras : <ul> <li>#EXTRA_SESSION_KEY, a String for the session key, as returned by #startProvisionedVpnProfileSession. <li>#EXTRA_TIMESTAMP_MILLIS, a long for the timestamp at which the error occurred, in milliseconds since the epoch, as returned by java.lang.System#currentTimeMillis. <li>#EXTRA_UNDERLYING_NETWORK, a Network containing the underlying network at the time the error occurred, or null if none. Note that this network may have disconnected already. <li>#EXTRA_UNDERLYING_NETWORK_CAPABILITIES, a NetworkCapabilities for the underlying network at the time the error occurred. <li>#EXTRA_UNDERLYING_LINK_PROPERTIES, a LinkProperties for the underlying network at the time the error occurred. </ul> When this event is an error, either #CATEGORY_EVENT_IKE_ERROR or #CATEGORY_EVENT_NETWORK_ERROR, the following extras will be populated : <ul> <li>#EXTRA_ERROR_CLASS, an int for the class of error, either #ERROR_CLASS_RECOVERABLE or #ERROR_CLASS_NOT_RECOVERABLE. <li>#EXTRA_ERROR_CODE, an int error code specific to the error. See #EXTRA_ERROR_CODE for details. </ul>

Java documentation for android.net.VpnManager.ACTION_VPN_MANAGER_EVENT.

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