diff options
author | Roshan Pius <rpius@google.com> | 2017-03-31 10:08:04 -0700 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2017-03-31 23:37:39 +0000 |
commit | d44fca25d34d80d98c242423c3a5504a325553ab (patch) | |
tree | 74977c96ad8708e7d1c50935fdb60641f092c0dc /tests | |
parent | 63a874bf77ec9b59ae6113e17fd90221c64125fb (diff) |
XmlUtil: Restore networks with CURRENT status as ENABLED
When the device reboots while connected to a network, they might have
their status saved as CURRENT in the xml store file. When this is being
restored, we need to set this network status as ENABLED (since it is not
connected at the point of restore).
Bug: 35811529
Test: Unit tests
Change-Id: I282f56a1c5c3e78b98fb23913772636be68e0f20
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java b/tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java index d61809882..0942b8328 100644 --- a/tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java +++ b/tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java @@ -212,6 +212,21 @@ public class XmlUtilTest { } /** + * Verify that a WifiConfiguration with status as CURRENT when serializing + * is deserialized as ENABLED. + */ + @Test + public void testCurrentStatusConfigurationSerializeDeserializeForConfigStore() + throws IOException, XmlPullParserException { + WifiConfiguration configuration = WifiConfigurationTestUtil.createEapNetwork(); + configuration.status = WifiConfiguration.Status.CURRENT; + byte[] xmlData = serializeWifiConfigurationForConfigStore(configuration); + Pair<String, WifiConfiguration> deserializedConfiguration = + deserializeWifiConfiguration(xmlData); + assertEquals(WifiConfiguration.Status.ENABLED, deserializedConfiguration.second.status); + } + + /** * Verify that an enabled network selection status object is serialized & deserialized * correctly. */ |