VpnManager.ProvisionVpnProfile(PlatformVpnProfile) Method

Definition

Install a VpnProfile configuration keyed on the calling app's package name.

[Android.Runtime.Register("provisionVpnProfile", "(Landroid/net/PlatformVpnProfile;)Landroid/content/Intent;", "GetProvisionVpnProfile_Landroid_net_PlatformVpnProfile_Handler", ApiSince=30)]
public virtual Android.Content.Intent? ProvisionVpnProfile (Android.Net.PlatformVpnProfile profile);
[<Android.Runtime.Register("provisionVpnProfile", "(Landroid/net/PlatformVpnProfile;)Landroid/content/Intent;", "GetProvisionVpnProfile_Landroid_net_PlatformVpnProfile_Handler", ApiSince=30)>]
abstract member ProvisionVpnProfile : Android.Net.PlatformVpnProfile -> Android.Content.Intent
override this.ProvisionVpnProfile : Android.Net.PlatformVpnProfile -> Android.Content.Intent

Parameters

profile
PlatformVpnProfile

the VpnProfile provided by this package. Will override any previous VpnProfile stored for this package.

Returns

an Intent requesting user consent to start the VPN, or null if consent is not required based on privileges or previous user consent.

Attributes

Remarks

Install a VpnProfile configuration keyed on the calling app's package name.

This method returns null if user consent has already been granted, or an Intent to a system activity. If an intent is returned, the application should launch the activity using Activity#startActivityForResult to request user consent. The activity may pop up a dialog to require user action, and the result will come back via its Activity#onActivityResult. If the result is Activity#RESULT_OK, the user has consented, and the VPN profile can be started.

Java documentation for android.net.VpnManager.provisionVpnProfile(android.net.PlatformVpnProfile).

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