diff --git a/tests/cts/net/src/android/net/cts/IpConfigurationTest.java b/tests/cts/net/src/android/net/cts/IpConfigurationTest.java
index 21be351..c6bc077 100644
--- a/tests/cts/net/src/android/net/cts/IpConfigurationTest.java
+++ b/tests/cts/net/src/android/net/cts/IpConfigurationTest.java
@@ -16,6 +16,8 @@
 
 package android.net.cts;
 
+import static com.android.testutils.ParcelUtilsKt.assertParcelSane;
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
 
@@ -37,13 +39,6 @@
 
 @RunWith(AndroidJUnit4.class)
 public final class IpConfigurationTest {
-    private static final int TYPE_IPASSIGNMENT_STATIC = 0;
-    private static final int TYPE_IPASSIGNMENT_DHCP   = 1;
-
-    private static final int TYPE_PROXY_SETTINGS_NONE   = 0;
-    private static final int TYPE_PROXY_SETTINGS_STATIC = 1;
-    private static final int TYPE_PROXY_SETTINGS_PAC    = 2;
-
     private static final LinkAddress LINKADDR = new LinkAddress("192.0.2.2/25");
     private static final InetAddress GATEWAY = InetAddressUtils.parseNumericAddress("192.0.2.1");
     private static final InetAddress DNS1 = InetAddressUtils.parseNumericAddress("8.8.8.8");
@@ -76,24 +71,31 @@
         assertIpConfigurationEqual(ipConfig, new IpConfiguration());
         assertIpConfigurationEqual(ipConfig, new IpConfiguration(ipConfig));
 
-        ipConfig = createIpConfiguration(TYPE_IPASSIGNMENT_STATIC,
-                TYPE_PROXY_SETTINGS_PAC);
+        ipConfig.setStaticIpConfiguration(mStaticIpConfig);
+        ipConfig.setHttpProxy(mProxy);
+
+        ipConfig.setIpAssignment(IpConfiguration.IpAssignment.STATIC);
+        ipConfig.setProxySettings(IpConfiguration.ProxySettings.PAC);
         assertIpConfigurationEqual(ipConfig, new IpConfiguration(ipConfig));
 
-        ipConfig = createIpConfiguration(TYPE_IPASSIGNMENT_STATIC,
-                TYPE_PROXY_SETTINGS_STATIC);
+        ipConfig.setIpAssignment(IpConfiguration.IpAssignment.STATIC);
+        ipConfig.setProxySettings(IpConfiguration.ProxySettings.STATIC);
         assertIpConfigurationEqual(ipConfig, new IpConfiguration(ipConfig));
 
-        ipConfig = createIpConfiguration(TYPE_IPASSIGNMENT_DHCP,
-                TYPE_PROXY_SETTINGS_PAC);
+        ipConfig.setIpAssignment(IpConfiguration.IpAssignment.DHCP);
+        ipConfig.setProxySettings(IpConfiguration.ProxySettings.PAC);
         assertIpConfigurationEqual(ipConfig, new IpConfiguration(ipConfig));
 
-        ipConfig = createIpConfiguration(TYPE_IPASSIGNMENT_DHCP,
-                TYPE_PROXY_SETTINGS_STATIC);
+        ipConfig.setIpAssignment(IpConfiguration.IpAssignment.DHCP);
+        ipConfig.setProxySettings(IpConfiguration.ProxySettings.PAC);
         assertIpConfigurationEqual(ipConfig, new IpConfiguration(ipConfig));
 
-        ipConfig = createIpConfiguration(TYPE_IPASSIGNMENT_DHCP,
-                TYPE_PROXY_SETTINGS_NONE);
+        ipConfig.setIpAssignment(IpConfiguration.IpAssignment.DHCP);
+        ipConfig.setProxySettings(IpConfiguration.ProxySettings.STATIC);
+        assertIpConfigurationEqual(ipConfig, new IpConfiguration(ipConfig));
+
+        ipConfig.setIpAssignment(IpConfiguration.IpAssignment.DHCP);
+        ipConfig.setProxySettings(IpConfiguration.ProxySettings.NONE);
         assertIpConfigurationEqual(ipConfig, new IpConfiguration(ipConfig));
     }
 
@@ -106,46 +108,16 @@
         assertNull(config.getHttpProxy());
     }
 
-    private IpConfiguration createIpConfiguration(int ipAssignmentType,
-            int proxySettingType) {
-
-        final IpConfiguration ipConfig = new IpConfiguration();
-
-        switch (ipAssignmentType) {
-            case TYPE_IPASSIGNMENT_STATIC:
-                ipConfig.setIpAssignment(IpConfiguration.IpAssignment.STATIC);
-                break;
-            case TYPE_IPASSIGNMENT_DHCP:
-                ipConfig.setIpAssignment(IpConfiguration.IpAssignment.DHCP);
-                break;
-            default:
-                throw new IllegalArgumentException("Unknown ip assignment type.");
-        }
-
-        switch (proxySettingType) {
-            case TYPE_PROXY_SETTINGS_NONE:
-                ipConfig.setProxySettings(IpConfiguration.ProxySettings.NONE);
-                break;
-            case TYPE_PROXY_SETTINGS_STATIC:
-                ipConfig.setProxySettings(IpConfiguration.ProxySettings.STATIC);
-                break;
-            case TYPE_PROXY_SETTINGS_PAC:
-                ipConfig.setProxySettings(IpConfiguration.ProxySettings.PAC);
-                break;
-            default:
-                throw new IllegalArgumentException("Unknown proxy setting type.");
-        }
-
-        ipConfig.setStaticIpConfiguration(mStaticIpConfig);
-        ipConfig.setHttpProxy(mProxy);
-
-        return ipConfig;
-    }
-
     private void assertIpConfigurationEqual(IpConfiguration source, IpConfiguration target) {
         assertEquals(source.getIpAssignment(), target.getIpAssignment());
         assertEquals(source.getProxySettings(), target.getProxySettings());
         assertEquals(source.getHttpProxy(), target.getHttpProxy());
         assertEquals(source.getStaticIpConfiguration(), target.getStaticIpConfiguration());
     }
+
+    @Test
+    public void testParcel() {
+        final IpConfiguration config = new IpConfiguration();
+        assertParcelSane(config, 4);
+    }
 }
diff --git a/tests/cts/net/src/android/net/wifi/cts/WifiNetworkSpecifierTest.java b/tests/cts/net/src/android/net/wifi/cts/WifiNetworkSpecifierTest.java
index 83018fa..eb6d684 100644
--- a/tests/cts/net/src/android/net/wifi/cts/WifiNetworkSpecifierTest.java
+++ b/tests/cts/net/src/android/net/wifi/cts/WifiNetworkSpecifierTest.java
@@ -363,13 +363,17 @@
         testConnectionFlowWithSpecifier(specifier, true);
     }
 
+    private static String removeDoubleQuotes(String string) {
+        return WifiInfo.sanitizeSsid(string);
+    }
+
     private WifiNetworkSpecifier.Builder createSpecifierBuilderWithCredentialFromSavedNetwork() {
         WifiNetworkSpecifier.Builder specifierBuilder = new WifiNetworkSpecifier.Builder();
         if (mTestNetwork.preSharedKey != null) {
             if (mTestNetwork.allowedKeyManagement.get(WifiConfiguration.KeyMgmt.WPA_PSK)) {
-                specifierBuilder.setWpa2Passphrase(mTestNetwork.preSharedKey);
+                specifierBuilder.setWpa2Passphrase(removeDoubleQuotes(mTestNetwork.preSharedKey));
             } else if (mTestNetwork.allowedKeyManagement.get(WifiConfiguration.KeyMgmt.SAE)) {
-                specifierBuilder.setWpa3Passphrase(mTestNetwork.preSharedKey);
+                specifierBuilder.setWpa3Passphrase(removeDoubleQuotes(mTestNetwork.preSharedKey));
             } else {
                 fail("Unsupported security type found in saved networks");
             }
@@ -391,7 +395,7 @@
             return;
         }
         WifiNetworkSpecifier specifier = createSpecifierBuilderWithCredentialFromSavedNetwork()
-                .setSsid(WifiInfo.sanitizeSsid(mTestNetwork.SSID))
+                .setSsid(removeDoubleQuotes(mTestNetwork.SSID))
                 .build();
         testSuccessfulConnectionWithSpecifier(specifier);
     }
@@ -406,7 +410,7 @@
         }
         // Creates a ssid pattern by dropping the last char in the saved network & pass that
         // as a prefix match pattern in the request.
-        String ssidUnquoted = WifiInfo.sanitizeSsid(mTestNetwork.SSID);
+        String ssidUnquoted = removeDoubleQuotes(mTestNetwork.SSID);
         assertThat(ssidUnquoted.length()).isAtLeast(2);
         String ssidPrefix = ssidUnquoted.substring(0, ssidUnquoted.length() - 1);
         // Note: The match may return more than 1 network in this case since we use a prefix match,
@@ -460,7 +464,7 @@
         List<ScanResult> scanResults = mWifiManager.getScanResults();
         if (scanResults == null || scanResults.isEmpty()) fail("No scan results available");
         for (ScanResult scanResult : scanResults) {
-            if (TextUtils.equals(scanResult.SSID, WifiInfo.sanitizeSsid(mTestNetwork.SSID))) {
+            if (TextUtils.equals(scanResult.SSID, removeDoubleQuotes(mTestNetwork.SSID))) {
                 return scanResult;
             }
         }
@@ -511,7 +515,7 @@
             return;
         }
         WifiNetworkSpecifier specifier = createSpecifierBuilderWithCredentialFromSavedNetwork()
-                .setSsid(WifiInfo.sanitizeSsid(mTestNetwork.SSID))
+                .setSsid(removeDoubleQuotes(mTestNetwork.SSID))
                 .build();
         testUserRejectionWithSpecifier(specifier);
     }
@@ -526,11 +530,11 @@
             return;
         }
         WifiNetworkSpecifier specifier1 = new WifiNetworkSpecifier.Builder()
-                .setSsid(WifiInfo.sanitizeSsid(mTestNetwork.SSID))
+                .setSsid(removeDoubleQuotes(mTestNetwork.SSID))
                 .setWpa2EnterpriseConfig(new WifiEnterpriseConfig())
                 .build();
         WifiNetworkSpecifier specifier2 = new WifiNetworkSpecifier.Builder()
-                .setSsid(WifiInfo.sanitizeSsid(mTestNetwork.SSID))
+                .setSsid(removeDoubleQuotes(mTestNetwork.SSID))
                 .setWpa2EnterpriseConfig(new WifiEnterpriseConfig())
                 .build();
         assertThat(specifier1.satisfiedBy(specifier2)).isTrue();
@@ -546,11 +550,11 @@
             return;
         }
         WifiNetworkSpecifier specifier1 = new WifiNetworkSpecifier.Builder()
-                .setSsid(WifiInfo.sanitizeSsid(mTestNetwork.SSID))
+                .setSsid(removeDoubleQuotes(mTestNetwork.SSID))
                 .setWpa3EnterpriseConfig(new WifiEnterpriseConfig())
                 .build();
         WifiNetworkSpecifier specifier2 = new WifiNetworkSpecifier.Builder()
-                .setSsid(WifiInfo.sanitizeSsid(mTestNetwork.SSID))
+                .setSsid(removeDoubleQuotes(mTestNetwork.SSID))
                 .setWpa3EnterpriseConfig(new WifiEnterpriseConfig())
                 .build();
         assertThat(specifier1.satisfiedBy(specifier2)).isTrue();
