Loading packages/Connectivity/framework/api/module-lib-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -31,9 +31,11 @@ package android.net { public final class NetworkAgentConfig implements android.os.Parcelable { method @Nullable public String getSubscriberId(); method public boolean isBypassableVpn(); } 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); } Loading packages/Connectivity/framework/src/android/net/NetworkAgentConfig.java +23 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,16 @@ public final class NetworkAgentConfig implements Parcelable { 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 * only if {@link explicitlySelected} is true. If it is, this field must also be set to the Loading Loading @@ -346,6 +356,19 @@ public final class NetworkAgentConfig implements Parcelable { 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. */ Loading services/core/java/com/android/server/connectivity/Vpn.java +3 −2 Original line number Diff line number Diff line Loading @@ -1242,8 +1242,9 @@ public class Vpn { mLegacyState = LegacyVpnInfo.STATE_CONNECTING; updateState(DetailedState.CONNECTING, "agentConnect"); NetworkAgentConfig networkAgentConfig = new NetworkAgentConfig.Builder().build(); networkAgentConfig.allowBypass = mConfig.allowBypass && !mLockdown; final NetworkAgentConfig networkAgentConfig = new NetworkAgentConfig.Builder() .setBypassableVpn(mConfig.allowBypass && !mLockdown) .build(); mNetworkCapabilities.setOwnerUid(mOwnerUID); mNetworkCapabilities.setAdministratorUids(new int[] {mOwnerUID}); Loading Loading
packages/Connectivity/framework/api/module-lib-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -31,9 +31,11 @@ package android.net { public final class NetworkAgentConfig implements android.os.Parcelable { method @Nullable public String getSubscriberId(); method public boolean isBypassableVpn(); } 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); } Loading
packages/Connectivity/framework/src/android/net/NetworkAgentConfig.java +23 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,16 @@ public final class NetworkAgentConfig implements Parcelable { 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 * only if {@link explicitlySelected} is true. If it is, this field must also be set to the Loading Loading @@ -346,6 +356,19 @@ public final class NetworkAgentConfig implements Parcelable { 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. */ Loading
services/core/java/com/android/server/connectivity/Vpn.java +3 −2 Original line number Diff line number Diff line Loading @@ -1242,8 +1242,9 @@ public class Vpn { mLegacyState = LegacyVpnInfo.STATE_CONNECTING; updateState(DetailedState.CONNECTING, "agentConnect"); NetworkAgentConfig networkAgentConfig = new NetworkAgentConfig.Builder().build(); networkAgentConfig.allowBypass = mConfig.allowBypass && !mLockdown; final NetworkAgentConfig networkAgentConfig = new NetworkAgentConfig.Builder() .setBypassableVpn(mConfig.allowBypass && !mLockdown) .build(); mNetworkCapabilities.setOwnerUid(mOwnerUID); mNetworkCapabilities.setAdministratorUids(new int[] {mOwnerUID}); Loading