VpnManager.ProvisionVpnProfile(PlatformVpnProfile) 方法

定义

在调用应用的包名称上安装一个 Keyed 的 VpnProfile 配置。

[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

参数

profile
PlatformVpnProfile

此包提供的 VpnProfile。 将替代为此包存储的任何以前的 VpnProfile。

返回

请求用户同意启动 VPN 的意向,如果不需要许可,则为 null(如果不需要基于特权或以前的用户同意)。

属性

注解

在调用应用的包名称上安装一个 Keyed 的 VpnProfile 配置。

此方法返回 null 用户同意是否已授予或 Intent 系统活动。 如果返回意向,应用程序应启动活动 Activity#startActivityForResult 以请求用户同意。 活动可能会弹出一个对话框来要求用户操作,结果将通过该 Activity#onActivityResult对话框返回。 如果结果是 Activity#RESULT_OK,则表示用户已同意,并且可以启动 VPN 配置文件。

适用于 . 的 android.net.VpnManager.provisionVpnProfile(android.net.PlatformVpnProfile)Java 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于