Merge "Change naming of excludeLocalRoutes"

This commit is contained in:
Chiachang Wang
2022-02-10 00:50:30 +00:00
committed by Gerrit Code Review
4 changed files with 8 additions and 8 deletions

View File

@@ -132,7 +132,7 @@ package android.net {
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 setBypassableVpn(boolean);
method @NonNull public android.net.NetworkAgentConfig.Builder setExcludeLocalRoutesVpn(boolean); method @NonNull public android.net.NetworkAgentConfig.Builder setLocalRoutesExcludedForVpn(boolean);
method @NonNull public android.net.NetworkAgentConfig.Builder setSubscriberId(@Nullable String); method @NonNull public android.net.NetworkAgentConfig.Builder setSubscriberId(@Nullable String);
method @NonNull public android.net.NetworkAgentConfig.Builder setVpnRequiresValidation(boolean); method @NonNull public android.net.NetworkAgentConfig.Builder setVpnRequiresValidation(boolean);
} }

View File

@@ -244,7 +244,7 @@ public final class NetworkAgentConfig implements Parcelable {
* @return whether local traffic is excluded from the VPN network. * @return whether local traffic is excluded from the VPN network.
* @hide * @hide
*/ */
public boolean getExcludeLocalRouteVpn() { public boolean areLocalRoutesExcludedForVpn() {
return excludeLocalRouteVpn; return excludeLocalRouteVpn;
} }
@@ -472,7 +472,7 @@ public final class NetworkAgentConfig implements Parcelable {
*/ */
@NonNull @NonNull
@SystemApi(client = MODULE_LIBRARIES) @SystemApi(client = MODULE_LIBRARIES)
public Builder setExcludeLocalRoutesVpn(boolean excludeLocalRoutes) { public Builder setLocalRoutesExcludedForVpn(boolean excludeLocalRoutes) {
mConfig.excludeLocalRouteVpn = excludeLocalRoutes; mConfig.excludeLocalRouteVpn = excludeLocalRoutes;
return this; return this;
} }

View File

@@ -51,7 +51,7 @@ class NetworkAgentConfigTest {
setBypassableVpn(true) setBypassableVpn(true)
} }
if (isAtLeastT()) { if (isAtLeastT()) {
setExcludeLocalRoutesVpn(true) setLocalRoutesExcludedForVpn(true)
setVpnRequiresValidation(true) setVpnRequiresValidation(true)
} }
}.build() }.build()
@@ -75,7 +75,7 @@ class NetworkAgentConfigTest {
setBypassableVpn(true) setBypassableVpn(true)
} }
if (isAtLeastT()) { if (isAtLeastT()) {
setExcludeLocalRoutesVpn(true) setLocalRoutesExcludedForVpn(true)
setVpnRequiresValidation(true) setVpnRequiresValidation(true)
} }
}.build() }.build()
@@ -87,7 +87,7 @@ class NetworkAgentConfigTest {
assertTrue(config.isUnvalidatedConnectivityAcceptable()) assertTrue(config.isUnvalidatedConnectivityAcceptable())
assertEquals("TEST_NETWORK", config.getLegacyTypeName()) assertEquals("TEST_NETWORK", config.getLegacyTypeName())
if (isAtLeastT()) { if (isAtLeastT()) {
assertTrue(config.getExcludeLocalRouteVpn()) assertTrue(config.areLocalRoutesExcludedForVpn())
assertTrue(config.getVpnRequiresValidation()) assertTrue(config.getVpnRequiresValidation())
} }
if (isAtLeastS()) { if (isAtLeastS()) {

View File

@@ -270,11 +270,11 @@ public class Ikev2VpnProfileTest {
public void testBuildExcludeLocalRoutesSet() throws Exception { public void testBuildExcludeLocalRoutesSet() throws Exception {
final Ikev2VpnProfile.Builder builder = getBuilderWithDefaultOptions(); final Ikev2VpnProfile.Builder builder = getBuilderWithDefaultOptions();
builder.setAuthPsk(PSK_BYTES); builder.setAuthPsk(PSK_BYTES);
builder.setExcludeLocalRoutes(true); builder.setLocalRoutesExcluded(true);
final Ikev2VpnProfile profile = builder.build(); final Ikev2VpnProfile profile = builder.build();
assertNotNull(profile); assertNotNull(profile);
assertTrue(profile.getExcludeLocalRoutes()); assertTrue(profile.areLocalRoutesExcluded());
builder.setBypassable(false); builder.setBypassable(false);
try { try {