# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Methods | Inherited Methods

# VpnManager

`public class VpnManager`
`extends Object` ``

java.lang.Object
↳ | android.net.VpnManager

This class provides an interface for apps to manage platform VPN profiles

Apps can use this API to provide profiles with which the platform can set up a VPN without further app intermediation. When a VPN profile is present and the app is selected as an always-on VPN, the platform will directly trigger the negotiation of the VPN without starting or waking the app (unlike VpnService).

VPN apps using supported protocols should preferentially use this API over the `VpnService` API for ease-of-development and reduced maintainance burden. This also give the user the guarantee that VPN network traffic is not subjected to on-device packet interception.

See also:

- `Ikev2VpnProfile`

## Summary

### Public methods
`void` | `deleteProvisionedVpnProfile()` Delete the VPN profile configuration that was provisioned by the calling app
`Intent` | `provisionVpnProfile(PlatformVpnProfile profile)` Install a VpnProfile configuration keyed on the calling app's package name.
`void` | `startProvisionedVpnProfile()` Request the startup of a previously provisioned VPN.
`void` | `stopProvisionedVpnProfile()` Tear down the VPN provided by the calling app (if any)

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Public methods

### deleteProvisionedVpnProfile

    public void deleteProvisionedVpnProfile ()

Delete the VPN profile configuration that was provisioned by the calling app

Throws
`SecurityException` | if this would violate user settings

### provisionVpnProfile

    public Intent provisionVpnProfile (PlatformVpnProfile profile)

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(int, int, Intent)`. If the result is `Activity#RESULT_OK`, the user has consented, and the VPN profile can be started.

Parameters
`profile` | `PlatformVpnProfile`: the VpnProfile provided by this package. Will override any previous VpnProfile stored for this package. This value cannot be `null`.

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

### startProvisionedVpnProfile

    public void startProvisionedVpnProfile ()

Request the startup of a previously provisioned VPN.

Throws
`SecurityException` | exception if user or device settings prevent this VPN from being setup, or if user consent has not been granted

### stopProvisionedVpnProfile

    public void stopProvisionedVpnProfile ()

Tear down the VPN provided by the calling app (if any)

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*