summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author chiachangwang <chiachangwang@google.com> 2022-08-30 10:13:49 +0000
committer Cherrypicker Worker <android-build-cherrypicker-worker@google.com> 2022-09-06 06:49:28 +0000
commit9a80121f6b3a7e238008b533d972a4441f27c736 (patch)
tree0cb0d0a13effb8c5fb5099e49c1fb4b375e084a8
parent96fd9fad38ee8d6ef666d24ad31cb576b3ab6f36 (diff)
Correctly handle null ProxyInfo in Ikev2VpnProfile
This change ensures that null ProxyInfo instances are honored and reflected in the actual VpnProfile. Ikev2VpnProfiles incorrectly set ProxyInfo as an empty instance when provided with a null ProxyInfo. Other components in the system sometimes have different behavior if presented with an empty ProxyInfo instead of a null one. Bug: 244281603 Test: atest FrameworksNetTests Test: Manual testing with VPN validation enabled Change-Id: I67ee2aa5c96dc22ba8fcd2be3fd4c090dec20697 (cherry picked from commit 29348dbfca787235ae1eabbe1a8b7b262187f197) Merged-In: I67ee2aa5c96dc22ba8fcd2be3fd4c090dec20697
-rw-r--r--core/java/android/net/Ikev2VpnProfile.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/java/android/net/Ikev2VpnProfile.java b/core/java/android/net/Ikev2VpnProfile.java
index ba0546aceb95..3979c6c78dcb 100644
--- a/core/java/android/net/Ikev2VpnProfile.java
+++ b/core/java/android/net/Ikev2VpnProfile.java
@@ -171,7 +171,7 @@ public final class Ikev2VpnProfile extends PlatformVpnProfile {
mPassword = password;
mRsaPrivateKey = rsaPrivateKey;
mUserCert = userCert;
- mProxyInfo = new ProxyInfo(proxyInfo);
+ mProxyInfo = (proxyInfo == null) ? null : new ProxyInfo(proxyInfo);
// UnmodifiableList doesn't make a defensive copy by default.
mAllowedAlgorithms = Collections.unmodifiableList(new ArrayList<>(allowedAlgorithms));