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
diff --git a/core/java/android/net/Ikev2VpnProfile.java b/core/java/android/net/Ikev2VpnProfile.java
index ba0546a..3979c6c 100644
--- a/core/java/android/net/Ikev2VpnProfile.java
+++ b/core/java/android/net/Ikev2VpnProfile.java
@@ -171,7 +171,7 @@
         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));