WifiManagerTest: Set key mgmt field in testWifiManagerNetWork

By default |allowedKeyMgmt| is set to WPA_PSK, however the
|preSharedKey| is not set for this WifiConfiguration. So, the new
|validate| method added in ag/2339612, will reject the network update
(rightly so, because it's an invalid configuration). So, set the key
mgmt to |NONE| to indicate that this is an open network and hence does
not need the |preSharedKey| field.

Bug: 62418044
Test: Failing test passes now.
Change-Id: If979b909f2fb7d7b4e2626b57eff407ba6a019ab
(cherry picked from commit c7f4afa63708d898b7c0d0562b8b3ee3608114fe)
This commit is contained in:
Roshan Pius
2017-06-07 15:56:56 -07:00
parent e0ea4b74fb
commit 929683c04f

View File

@@ -385,6 +385,7 @@ public class WifiManagerTest extends AndroidTestCase {
wifiConfiguration = new WifiConfiguration();
wifiConfiguration.SSID = SSID1;
wifiConfiguration.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
int netId = mWifiManager.addNetwork(wifiConfiguration);
assertTrue(existSSID(SSID1));