diff options
| author | lucaslin <lucaslin@google.com> | 2021-03-22 15:07:41 +0800 |
|---|---|---|
| committer | Lorenzo Colitti <lorenzo@google.com> | 2021-03-23 09:01:40 +0900 |
| commit | cdfe026c276ce9c90efe6002b6ea47ec6131b479 (patch) | |
| tree | d4152099c44a612410421abf1511bb9987d2ead4 /framework/src/android/net/NetworkAgentConfig.java | |
| parent | 92ed8b9bab91c88a5d66d82362d78bd98ae705f3 (diff) | |
Have a new method in NetworkAgentConfig.Builder to set allowBypass
Have a new method in NetworkAgentConfig.Builder for Vpn to set
allowBypass.
Bug: 182963397
Test: m
Change-Id: I3f244464438325ee7f8a1b953d3fb28186293628
Diffstat (limited to 'framework/src/android/net/NetworkAgentConfig.java')
| -rw-r--r-- | framework/src/android/net/NetworkAgentConfig.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/framework/src/android/net/NetworkAgentConfig.java b/framework/src/android/net/NetworkAgentConfig.java index 5e50a6404a..0bd2371bfc 100644 --- a/framework/src/android/net/NetworkAgentConfig.java +++ b/framework/src/android/net/NetworkAgentConfig.java @@ -64,6 +64,16 @@ public final class NetworkAgentConfig implements Parcelable { } /** + * @return whether this VPN connection can be bypassed by the apps. + * + * @hide + */ + @SystemApi(client = MODULE_LIBRARIES) + public boolean isBypassableVpn() { + return allowBypass; + } + + /** * Set if the user desires to use this network even if it is unvalidated. This field has meaning * only if {@link explicitlySelected} is true. If it is, this field must also be set to the * appropriate value based on previous user choice. @@ -347,6 +357,19 @@ public final class NetworkAgentConfig implements Parcelable { } /** + * Sets whether the apps can bypass the VPN connection. + * + * @return this builder, to facilitate chaining. + * @hide + */ + @NonNull + @SystemApi(client = MODULE_LIBRARIES) + public Builder setBypassableVpn(boolean allowBypass) { + mConfig.allowBypass = allowBypass; + return this; + } + + /** * Returns the constructed {@link NetworkAgentConfig} object. */ @NonNull |
