# PlatformVpnProfile

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Constants](https://developer.android.com/reference/android/net/PlatformVpnProfile#constants)\|[Methods](https://developer.android.com/reference/android/net/PlatformVpnProfile#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/net/PlatformVpnProfile#inhmethods)  

# PlatformVpnProfile

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/net/PlatformVpnProfile "View this page in Kotlin")\|Java

`
public


abstract
class
PlatformVpnProfile
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|--------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.net.PlatformVpnProfile |

|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known direct subclasses [Ikev2VpnProfile](https://developer.android.com/reference/android/net/Ikev2VpnProfile) |----------------------------------------------------------------------------------------|------------------------------------------------------------------------------------| | [Ikev2VpnProfile](https://developer.android.com/reference/android/net/Ikev2VpnProfile) | The Ikev2VpnProfile is a configuration for the platform setup of IKEv2/IPsec VPNs. | |

<br />

*** ** * ** ***

PlatformVpnProfile represents a configuration for a platform-based VPN implementation.

Platform-based VPNs allow VPN applications to provide configuration and authentication options to leverage the Android OS' implementations of well-defined control plane (authentication, key negotiation) and data plane (per-packet encryption) protocols to simplify the creation of VPN tunnels. In contrast,[VpnService](https://developer.android.com/reference/android/net/VpnService)based VPNs must implement both the control and data planes on a per-app basis.  
**See also:**

- [Ikev2VpnProfile](https://developer.android.com/reference/android/net/Ikev2VpnProfile)

## Summary

|                                                                 ### Constants                                                                 ||
|-------|----------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [TYPE_IKEV2_IPSEC_PSK](https://developer.android.com/reference/android/net/PlatformVpnProfile#TYPE_IKEV2_IPSEC_PSK) <br />             |
| `int` | [TYPE_IKEV2_IPSEC_RSA](https://developer.android.com/reference/android/net/PlatformVpnProfile#TYPE_IKEV2_IPSEC_RSA) <br />             |
| `int` | [TYPE_IKEV2_IPSEC_USER_PASS](https://developer.android.com/reference/android/net/PlatformVpnProfile#TYPE_IKEV2_IPSEC_USER_PASS) <br /> |

|                                                                                                                                   ### Public methods                                                                                                                                    ||
|-----------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` final boolean`                                                            | ` `[areLocalRoutesExcluded](https://developer.android.com/reference/android/net/PlatformVpnProfile#areLocalRoutesExcluded())`() ` Returns whether the local traffic is exempted from the VPN.              |
| ` final int`                                                                | ` `[getType](https://developer.android.com/reference/android/net/PlatformVpnProfile#getType())`() ` Returns the profile integer type.                                                                      |
| ` final `[String](https://developer.android.com/reference/java/lang/String) | ` `[getTypeString](https://developer.android.com/reference/android/net/PlatformVpnProfile#getTypeString())`() ` Returns a type string describing the VPN profile type                                      |
| ` final boolean`                                                            | ` `[isInternetValidationRequired](https://developer.android.com/reference/android/net/PlatformVpnProfile#isInternetValidationRequired())`() ` Returns whether this VPN should undergo Internet validation. |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Constants

### TYPE_IKEV2_IPSEC_PSK

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int TYPE_IKEV2_IPSEC_PSK
```

<br />

<br />

Constant Value: 7 (0x00000007)  

### TYPE_IKEV2_IPSEC_RSA

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int TYPE_IKEV2_IPSEC_RSA
```

<br />

<br />

Constant Value: 8 (0x00000008)  

### TYPE_IKEV2_IPSEC_USER_PASS

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int TYPE_IKEV2_IPSEC_USER_PASS
```

<br />

<br />

Constant Value: 6 (0x00000006)

## Public methods

### areLocalRoutesExcluded

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final boolean areLocalRoutesExcluded ()
```

Returns whether the local traffic is exempted from the VPN.

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### getType

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final int getType ()
```

Returns the profile integer type.

<br />

|                                                                                                                                                                                             Returns                                                                                                                                                                                              ||
|-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | Value is[TYPE_IKEV2_IPSEC_USER_PASS](https://developer.android.com/reference/android/net/PlatformVpnProfile#TYPE_IKEV2_IPSEC_USER_PASS),[TYPE_IKEV2_IPSEC_PSK](https://developer.android.com/reference/android/net/PlatformVpnProfile#TYPE_IKEV2_IPSEC_PSK), or[TYPE_IKEV2_IPSEC_RSA](https://developer.android.com/reference/android/net/PlatformVpnProfile#TYPE_IKEV2_IPSEC_RSA) <br /> |

### getTypeString

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final String getTypeString ()
```

Returns a type string describing the VPN profile type

<br />

|                                                Returns                                                 ||
|--------------------------------------------------------------------|------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | This value cannot be`null`. <br /> |

### isInternetValidationRequired

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final boolean isInternetValidationRequired ()
```

Returns whether this VPN should undergo Internet validation. If this is true, the platform will perform basic validation checks for Internet connectivity over this VPN. If and when they succeed, the VPN network capabilities will reflect this by gaining the[NetworkCapabilities.NET_CAPABILITY_VALIDATED](https://developer.android.com/reference/android/net/NetworkCapabilities#NET_CAPABILITY_VALIDATED)capability. If this is false, the platform assumes the VPN either is always capable of reaching the Internet or intends not to. In this case, the VPN network capabilities will always gain the[NetworkCapabilities.NET_CAPABILITY_VALIDATED](https://developer.android.com/reference/android/net/NetworkCapabilities#NET_CAPABILITY_VALIDATED)capability immediately after it connects, whether it can reach public Internet destinations or not.

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |