diff options
| author | 2017-07-14 17:17:12 +0200 | |
|---|---|---|
| committer | 2017-07-14 17:22:47 +0200 | |
| commit | 28a3e85903eab717f387514c8be99f90be8e29be (patch) | |
| tree | 3627a78aec877cd1e3ff31a3f9688481ea80134c | |
| parent | f75d22dcc0833bf25c95a11031c7923f9bff096f (diff) | |
Docs: VPNs under Android O should promote to the foreground
Add note for VPN developers that VPN apps started in the background must transition to the foreground in Android O to avoid the system stopping them.
Staged at: go/dac-stage/reference/android/net/VpnService.html
Test: make ds-docs
Bug: 38023983
Change-Id: I33c7ca1717c332ffab495eb51c4c6b9c5c304cef
| -rw-r--r-- | core/java/android/net/VpnService.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/core/java/android/net/VpnService.java b/core/java/android/net/VpnService.java index 2d9860cf0e40..4b79cbb98d8c 100644 --- a/core/java/android/net/VpnService.java +++ b/core/java/android/net/VpnService.java @@ -99,7 +99,7 @@ import java.util.List; * shut down the tunnel gracefully.</li> * </ol> * - * <p>Services extended this class need to be declared with appropriate + * <p>Services extending this class need to be declared with an appropriate * permission and intent filter. Their access must be secured by * {@link android.Manifest.permission#BIND_VPN_SERVICE} permission, and * their intent filter must match {@link #SERVICE_INTERFACE} action. Here @@ -112,6 +112,13 @@ import java.util.List; * </intent-filter> * </service></pre> * + * <p> The Android system starts a VPN in the background by calling + * {@link android.content.Context#startService startService()}. In Android 8.0 + * (API level 26) and higher, the system places VPN apps on the temporary + * whitelist for a short period so the app can start in the background. The VPN + * app must promote itself to the foreground after it's launched or the system + * will shut down the app. + * * @see Builder */ public class VpnService extends Service { |