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