Merge "Allow excludeLocalRoutes set only in bypassable profile"

This commit is contained in:
Chiachang Wang
2022-01-11 08:56:38 +00:00
committed by Gerrit Code Review

View File

@@ -163,6 +163,10 @@ public final class Ikev2VpnProfile extends PlatformVpnProfile {
// UnmodifiableList doesn't make a defensive copy by default.
mAllowedAlgorithms = Collections.unmodifiableList(new ArrayList<>(allowedAlgorithms));
if (excludeLocalRoutes && !isBypassable) {
throw new IllegalArgumentException(
"Vpn should be byassable if excludeLocalRoutes is set");
}
mIsBypassable = isBypassable;
mIsMetered = isMetered;