Merge "Set local routes exclusion in the networkAgent" am: 4734b5810b am: b8cda9d7e0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1978095 Change-Id: I46931b7926b1da889989384159b012826e02d96a
This commit is contained in:
@@ -106,6 +106,7 @@ public class VpnConfig implements Parcelable {
|
||||
public boolean allowIPv6;
|
||||
public boolean isMetered = true;
|
||||
public boolean requiresInternetValidation = false;
|
||||
public boolean excludeLocalRoutes = false;
|
||||
public Network[] underlyingNetworks;
|
||||
public ProxyInfo proxyInfo;
|
||||
|
||||
@@ -133,6 +134,7 @@ public class VpnConfig implements Parcelable {
|
||||
allowIPv6 = other.allowIPv6;
|
||||
isMetered = other.isMetered;
|
||||
requiresInternetValidation = other.requiresInternetValidation;
|
||||
excludeLocalRoutes = other.excludeLocalRoutes;
|
||||
underlyingNetworks = other.underlyingNetworks != null ? Arrays.copyOf(
|
||||
other.underlyingNetworks, other.underlyingNetworks.length) : null;
|
||||
proxyInfo = other.proxyInfo;
|
||||
@@ -192,6 +194,7 @@ public class VpnConfig implements Parcelable {
|
||||
out.writeInt(allowIPv6 ? 1 : 0);
|
||||
out.writeInt(isMetered ? 1 : 0);
|
||||
out.writeInt(requiresInternetValidation ? 1 : 0);
|
||||
out.writeInt(excludeLocalRoutes ? 1 : 0);
|
||||
out.writeTypedArray(underlyingNetworks, flags);
|
||||
out.writeParcelable(proxyInfo, flags);
|
||||
}
|
||||
@@ -220,6 +223,7 @@ public class VpnConfig implements Parcelable {
|
||||
config.allowIPv6 = in.readInt() != 0;
|
||||
config.isMetered = in.readInt() != 0;
|
||||
config.requiresInternetValidation = in.readInt() != 0;
|
||||
config.excludeLocalRoutes = in.readInt() != 0;
|
||||
config.underlyingNetworks = in.createTypedArray(Network.CREATOR);
|
||||
config.proxyInfo = in.readParcelable(null);
|
||||
return config;
|
||||
@@ -253,7 +257,8 @@ public class VpnConfig implements Parcelable {
|
||||
.append(", allowIPv4=").append(allowIPv4)
|
||||
.append(", allowIPv6=").append(allowIPv6)
|
||||
.append(", isMetered=").append(isMetered)
|
||||
.append(", requiresInternetValidation").append(requiresInternetValidation)
|
||||
.append(", requiresInternetValidation=").append(requiresInternetValidation)
|
||||
.append(", excludeLocalRoutes=").append(excludeLocalRoutes)
|
||||
.append(", underlyingNetworks=").append(Arrays.toString(underlyingNetworks))
|
||||
.append(", proxyInfo=").append(proxyInfo)
|
||||
.append("}")
|
||||
|
||||
@@ -1320,6 +1320,7 @@ public class Vpn {
|
||||
.setLegacyTypeName("VPN")
|
||||
.setBypassableVpn(mConfig.allowBypass && !mLockdown)
|
||||
.setVpnRequiresValidation(mConfig.requiresInternetValidation)
|
||||
.setLocalRoutesExcludedForVpn(mConfig.excludeLocalRoutes)
|
||||
.build();
|
||||
|
||||
capsBuilder.setOwnerUid(mOwnerUID);
|
||||
@@ -3386,6 +3387,7 @@ public class Vpn {
|
||||
mConfig.startTime = SystemClock.elapsedRealtime();
|
||||
mConfig.proxyInfo = profile.proxy;
|
||||
mConfig.requiresInternetValidation = profile.requiresInternetValidation;
|
||||
mConfig.excludeLocalRoutes = profile.excludeLocalRoutes;
|
||||
|
||||
switch (profile.type) {
|
||||
case VpnProfile.TYPE_IKEV2_IPSEC_USER_PASS:
|
||||
|
||||
Reference in New Issue
Block a user