diff options
author | Peter Qiu <zqiu@google.com> | 2017-07-27 14:41:36 -0700 |
---|---|---|
committer | Peter Qiu <zqiu@google.com> | 2017-08-10 21:14:07 +0000 |
commit | e97e21f1f14e4ef16dd5d675b17615aef3a80301 (patch) | |
tree | c0d81456794fed76a698ddc9d6ed7f5909a779f9 /tests | |
parent | 5a19b6b8f6b4a123371c6a2023a96e9d4f8d6aac (diff) |
Re-add network to supplicant when EAP identities changes
Update WifiConfigurationUtil#isSameNetwork to check changes in
both EAP identity and anonymous identity. So that the network
parameters in wpa_supplicant will get reloaded when the EAP
identities changed.
Bug: 63979263
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Test: Verify connection to a EAP-SIM network will fail after SIM card
is replaced
Change-Id: I592018de52c2515dbd64aea0138b5bc88b70fec7
(cherry picked from commit 8e08c5d97b1608e1b173867998dd82e6f44d1d13)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiConfigurationUtilTest.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConfigurationUtilTest.java b/tests/wifitests/src/com/android/server/wifi/WifiConfigurationUtilTest.java index 376d686a4..2925273de 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiConfigurationUtilTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiConfigurationUtilTest.java @@ -495,6 +495,31 @@ public class WifiConfigurationUtilTest { assertFalse(WifiConfigurationUtil.isSameNetwork(network, network1)); } + /** + * Verify that WifiConfigurationUtil.isSameNetwork returns false when two WifiConfiguration + * objects have the different EAP identity. + */ + @Test + public void testIsSameNetworkReturnsFalseOnDifferentEapIdentity() { + WifiConfiguration network1 = WifiConfigurationTestUtil.createEapNetwork(TEST_SSID); + WifiConfiguration network2 = WifiConfigurationTestUtil.createEapNetwork(TEST_SSID); + network1.enterpriseConfig.setIdentity("Identity1"); + network2.enterpriseConfig.setIdentity("Identity2"); + assertFalse(WifiConfigurationUtil.isSameNetwork(network1, network2)); + } + + /** + * Verify that WifiConfigurationUtil.isSameNetwork returns false when two WifiConfiguration + * objects have the different EAP anonymous identity. + */ + @Test + public void testIsSameNetworkReturnsFalseOnDifferentEapAnonymousIdentity() { + WifiConfiguration network1 = WifiConfigurationTestUtil.createEapNetwork(TEST_SSID); + WifiConfiguration network2 = WifiConfigurationTestUtil.createEapNetwork(TEST_SSID); + network1.enterpriseConfig.setAnonymousIdentity("Identity1"); + network2.enterpriseConfig.setAnonymousIdentity("Identity2"); + assertFalse(WifiConfigurationUtil.isSameNetwork(network1, network2)); + } /** * Verify the instance of {@link android.net.wifi.WifiScanner.PnoSettings.PnoNetwork} created |