diff options
author | Roshan Pius <rpius@google.com> | 2016-06-05 17:34:15 -0700 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2016-06-07 12:52:01 -0700 |
commit | e33a4bb414892435c016486585c26022cafdab68 (patch) | |
tree | d47dc981d44b8558510eead9d76b123e4e51de1c /tests/wifitests/src/com/android/server/wifi/WifiBackupRestoreTest.java | |
parent | 3031903d4a68659350994571525fc86a47c02dd0 (diff) | |
download | android_frameworks_opt_net_wifi-e33a4bb414892435c016486585c26022cafdab68.tar.gz android_frameworks_opt_net_wifi-e33a4bb414892435c016486585c26022cafdab68.tar.bz2 android_frameworks_opt_net_wifi-e33a4bb414892435c016486585c26022cafdab68.zip |
XmlUtil: Move Wifi/IP-Configuration serialization
Move the serialization/deserialization of WifiConfiguration &
IpConfiguration objects to XmlUtil. This helps us to share this logic
between WifiBackupRestore & WifiConfigStore.
Changes in the CL:
1. Create |WifiConfigurationXmlUtil| for WifiConfiguration
serialization.
2. Create |IpConfigurationXmlUtil| for IpConfiguration
serialization.
3. Change the XML structure of backup data to remove nesting of objects.
Nesting of objects makes it difficult to deserialize especially when we
start adding elements in future revisions. So, move |IpConfiguration|
object outside the |WifiConfiguration| object.
BUG: 29071904
Change-Id: Id08040bf11e4914638ec9f8d9d27d7983e27e42a
TEST: Unit-tests
TEST: Manual verification of backup/restore using bmgr commands.
Diffstat (limited to 'tests/wifitests/src/com/android/server/wifi/WifiBackupRestoreTest.java')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiBackupRestoreTest.java | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiBackupRestoreTest.java b/tests/wifitests/src/com/android/server/wifi/WifiBackupRestoreTest.java index 518d1cb7b..58de72158 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiBackupRestoreTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiBackupRestoreTest.java @@ -687,30 +687,12 @@ public class WifiBackupRestoreTest { for (WifiConfiguration actualConfiguration : actual) { String actualConfigKey = actualConfiguration.configKey(); if (actualConfigKey.equals(expectedConfigKey)) { - assertConfigurationEqual(expectedConfiguration, actualConfiguration); + WifiConfigurationTestUtil.assertConfigurationEqual( + expectedConfiguration, actualConfiguration); didCompare = true; } } assertTrue(didCompare); } } - - /** - * Asserts that the 2 WifiConfigurations are equal - */ - private void assertConfigurationEqual( - WifiConfiguration expected, WifiConfiguration actual) { - assertEquals(expected.SSID, actual.SSID); - assertEquals(expected.BSSID, actual.BSSID); - assertEquals(expected.preSharedKey, actual.preSharedKey); - assertEquals(expected.wepKeys, actual.wepKeys); - assertEquals(expected.wepTxKeyIndex, actual.wepTxKeyIndex); - assertEquals(expected.hiddenSSID, actual.hiddenSSID); - assertEquals(expected.allowedKeyManagement, actual.allowedKeyManagement); - assertEquals(expected.allowedProtocols, actual.allowedProtocols); - assertEquals(expected.allowedAuthAlgorithms, actual.allowedAuthAlgorithms); - assertEquals(expected.shared, actual.shared); - assertEquals(expected.creatorUid, actual.creatorUid); - assertEquals(expected.getIpConfiguration(), actual.getIpConfiguration()); - } } |