diff options
| author | Chalard Jean <jchalard@google.com> | 2018-03-29 17:45:24 +0900 |
|---|---|---|
| committer | Chalard Jean <jchalard@google.com> | 2018-03-29 18:10:56 +0900 |
| commit | e8785fb0e4eb6e87b396f81b3e08a8b350677183 (patch) | |
| tree | 4d7e781dd2e486d3a86d571b82574e66032f14fe /core/java/android | |
| parent | 45bd60b4e2bc4609713a349b2dbe31a233fbedd7 (diff) | |
Clarify documentation for getActiveNetworkInfo and friends
For VPNs it's unobvious what these methods do, so document that.
Bug: 70917007
Test: Comment changes only. Checkdoc passes.
Change-Id: I31ec1aea356d88d969eaf9fc7d8c2ed13ce924eb
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/net/ConnectivityManager.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java index 9d518e9e00fa..40f47b0cda27 100644 --- a/core/java/android/net/ConnectivityManager.java +++ b/core/java/android/net/ConnectivityManager.java @@ -861,6 +861,10 @@ public class ConnectivityManager { * You should always check {@link NetworkInfo#isConnected()} before initiating * network traffic. This may return {@code null} when there is no default * network. + * Note that if the default network is a VPN, this method will return the + * NetworkInfo for one of its underlying networks instead, or null if the + * VPN agent did not specify any. Apps interested in learning about VPNs + * should use {@link #getNetworkInfo(android.net.Network)} instead. * * @return a {@link NetworkInfo} object for the current default network * or {@code null} if no default network is currently active @@ -1018,7 +1022,11 @@ public class ConnectivityManager { * which you're interested. * @return a {@link NetworkInfo} object for the requested * network type or {@code null} if the type is not - * supported by the device. + * supported by the device. If {@code networkType} is + * TYPE_VPN and a VPN is active for the calling app, + * then this method will try to return one of the + * underlying networks for the VPN or null if the + * VPN agent didn't specify any. * * @deprecated This method does not support multiple connected networks * of the same type. Use {@link #getAllNetworks} and |
