Merge changes from topics "nonAutoIPSelection", "preferredIpProtocol" am: ec59bee3db am: a7083f38d2

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2483095

Change-Id: Ieeccf8c21357d2f16a00cf183b0a69f78b917f6e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Chiachang Wang
2023-03-20 03:55:41 +00:00
committed by Automerger Merge Worker

View File

@@ -3558,10 +3558,22 @@ public class Vpn {
+ mCurrentToken
+ " to network "
+ underlyingNetwork);
final int ipVersion = mProfile.isAutomaticIpVersionSelectionEnabled()
? guessEspIpVersionForNetwork() : ESP_IP_VERSION_AUTO;
final int encapType = mProfile.isAutomaticIpVersionSelectionEnabled()
? guessEspEncapTypeForNetwork() : ESP_ENCAP_TYPE_AUTO;
final int ipVersion;
final int encapType;
if (mProfile.isAutomaticIpVersionSelectionEnabled()) {
ipVersion = guessEspIpVersionForNetwork();
encapType = guessEspEncapTypeForNetwork();
} else if (mProfile.getIkeTunnelConnectionParams() != null) {
ipVersion = mProfile.getIkeTunnelConnectionParams()
.getIkeSessionParams().getIpVersion();
encapType = mProfile.getIkeTunnelConnectionParams()
.getIkeSessionParams().getEncapType();
} else {
ipVersion = ESP_IP_VERSION_AUTO;
encapType = ESP_ENCAP_TYPE_AUTO;
}
final int keepaliveDelaySeconds;
if (mProfile.isAutomaticNattKeepaliveTimerEnabled()) {
keepaliveDelaySeconds = guessNattKeepaliveTimerForNetwork();