Merge "Have a new method in NetworkAgentConfig.Builder to set allowBypass" am: 1a6e0ea3fd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1649288 Change-Id: I71d541b3578169410349356a149528954e1c8789
This commit is contained in:
@@ -31,9 +31,11 @@ package android.net {
|
|||||||
|
|
||||||
public final class NetworkAgentConfig implements android.os.Parcelable {
|
public final class NetworkAgentConfig implements android.os.Parcelable {
|
||||||
method @Nullable public String getSubscriberId();
|
method @Nullable public String getSubscriberId();
|
||||||
|
method public boolean isBypassableVpn();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final class NetworkAgentConfig.Builder {
|
public static final class NetworkAgentConfig.Builder {
|
||||||
|
method @NonNull public android.net.NetworkAgentConfig.Builder setBypassableVpn(boolean);
|
||||||
method @NonNull public android.net.NetworkAgentConfig.Builder setSubscriberId(@Nullable String);
|
method @NonNull public android.net.NetworkAgentConfig.Builder setSubscriberId(@Nullable String);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,16 @@ public final class NetworkAgentConfig implements Parcelable {
|
|||||||
return explicitlySelected;
|
return explicitlySelected;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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
|
* 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
|
* only if {@link explicitlySelected} is true. If it is, this field must also be set to the
|
||||||
@@ -346,6 +356,19 @@ public final class NetworkAgentConfig implements Parcelable {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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.
|
* Returns the constructed {@link NetworkAgentConfig} object.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user