History log of /frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
d44fca25d34d80d98c242423c3a5504a325553ab 31-Mar-2017 Roshan Pius <rpius@google.com> 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
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java
9ef555a48ac600c8766f703fa60db15b69e20301 10-Mar-2017 Peter Qiu <zqiu@google.com> WifiConfigurationXmlUtil: persist additional fields for legacy Passpoint configuration

When migrating legacy Passpoint configurations, the configuration will only
get migrated when its owner logs in. In the meantime, we will
need persist all the required data in the share store temporarily.
So persist the additional required fields for Passpoint to the storage
to avoid any data loss in the case when migration took multiple
boots to complete.

Bug: 36099588
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Test: manual test updating a device from N to O, verify all configs
are migrated.

Change-Id: I040dfd9f207ed1a9b2e3ccd50eca50560d6e1444
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java
7d100897cd3ab3a05c3925da42bd25af6e3c8c4a 15-Feb-2017 Roshan Pius <rpius@google.com> NetworkListStoreData: Handle runtime exceptions

The enterprise config setters can raise Illegal argument exceptions if
the data being set is incorrect. This shouldn't normally happen until
someone manipulates the XML (or downgrades as in the linked bug). Handle
such runtime exceptions gracefully and skip over that network block.

While there made a small nit,
Rename parse/writeWifiConfig to parse/writeNetwork to be symmetric with
other method names in the file.

Bug: 35244730
Test: Unit tests
Change-Id: I168eb383090712f7c5df388a6fcc3a1ed1055fe3
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java
6296902ef69724b106973b57b268c30ea4f1ab51 10-Feb-2017 Roshan Pius <rpius@google.com> XmlUtil: Persist WifiConfiguration.status field

Since WifiConfiguration.status field is publicly exposed we need
to persist this field across reboots. We could either,
a) Directly persist this field, or
b) Reset the field on every load using the retrieved NetworkSelectionStatus.

Going with option a) since i want to try and avoid too much logic like
this in the data loading path as much as possible. We don't use this
field internally and it's only used for external apps to check the
status of the network.

Bug: 35210874
Test: Unit test
Change-Id: I80d692affe628a29c29ad2f4b66f8c1e522b114b
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java
241605aebc6a8f55624026e8b72246bceb1c2ac2 03-Sep-2016 Roshan Pius <rpius@google.com> XmlUtil: Add couple of missing elements in WifiConfiguration

Add the cipher elements missing in the serialization/deserialization of
WifiConfiguration data. These fields generally have a default value set
in wpa_supplicant and so it wasn't detected earlier.
Also, add the missing requirePMF field.

BUG: 31246524
TEST: Unit tests
TEST: Verified that we can still connect to an EAP TLS network after
reboot.
Change-Id: I7bf1850738f15ec9d25b32521312db0b678c1e19
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java
0e2540a1c1ba3c541a229b039a90789f93c41ee7 28-Jul-2016 Roshan Pius <rpius@google.com> XmlUtil: Store NetworkSelectionStatus strings

Storing direct enum values in the XML file makes it difficult to
deprecate these enums later. So, instead store the string associated
with these status/disable reason in the XML file. If any of the
status/disable reason is deprecated, the reverse lookup of the index
from the corresponding string array will fail. Such networks are
restored as enabled (along with any temp disabled networks).

Also, moved the existing logic to re-enable temporarily disabled
networks to the |parseFromXml| method since we anyway need to perform
the above checks there.

BUG: 30448209
Change-Id: Ib8b8b1ab2b730853dddb7a1d716a2150b1a0f491
TEST: Unit tests
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java
f03d366f869da748d97706dbcfbd30b989186f4e 22-Jun-2016 Roshan Pius <rpius@google.com> WifiConfigurationTestUtil: Add helper methods

Move all the network configuration creation methods for different types
of networks (open, psk, wep, etc) to a common place. These tests don't
really care for the params like SSID, etc being set in the
configuration. So, there is no need for them to live in individual test.

While there,
Add the missing |updateTime| assertion in the comparator method.

BUG: 29577220
Change-Id: I1606773ad865b4766a84da6fdc8994cab072e808
TEST: Uni tests
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java
642b0bb43ed856bac0503d3169d67026de2c1b02 13-Jun-2016 Roshan Pius <rpius@google.com> XmlUtil: Add WifiEnterpriseConfigXmlUtil

Add a utility for |WifiEnterpriseConfig| class serialization/
deserialization.

While there,
Add missing java doc on the |writeToXml| methods.

BUG: 29318473
Change-Id: I83266631e17f42f55ce1b1a4fc263c975f414419
TEST: Unit tests
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java
c00a9331ab2a51babc3c3acd69f44be3d341c4b9 13-Jun-2016 Roshan Pius <rpius@google.com> XmlUtil: Report all parsing errors

Detect all XML parsing errors in XmlUtil and raise exceptions for them.
Changes in the CL:
1. Add new |gotoNextSection|* methods to raise exception when it does
not find a section with the expected tag name.
2. Raise exceptions for all errors in |WifiConfigurationXmlUtil|, etc.
3. |IpConfiguration| can never be null in WifiConfiguratin object, so
remove the conditional check in WifiBackupRestore.

While there,
Shorten the method names in |WifiConfigurationXmlUtil|, etc to
parseFromXml/writeToXml.

BUG: 29312911
Change-Id: I5bb152e9757f039410dd81afebaad009644e1414
TEST: Unit tests
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java
5d3609b1931180c37d7292619146ad7d33df9a21 10-Jun-2016 Roshan Pius <rpius@google.com> NetworkSelectionStatusXmlUtil: Add utility

Add a utility for |NetworkSelectionStatus| class serialization/
deserialization.

While there,
Fix the doc strings in the existing utils to add links to the original
object they're trying to serialize deserialize.

PS: Will add a follow up CL to shorten the method names of all these
utils: NetworkSelectionStatusXmlUtil.parseFromXml/writeToXml. The
current names are unnecessarily long.

BUG: 29273147
Change-Id: I59f056a2b99e8583930b716707284d4ccf14392a
TEST: Added Unit tests
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java
030c5debfefddf0512cd53fec48b269c08d9972e 10-Jun-2016 Roshan Pius <rpius@google.com> WifiConfigurationXmlUtil: Serialize all data for store

Add the remaining elements of WifiConfiguration that needs to be
persisted in config store and add unit-tests for verification.

PS: These elements are not serialized for backup/restore. Backup/Restore
only stores a selected subset of elements from WifiConfiguration.

While there,
Add the missing EAP configuration serialization unit tests.

BUG: 29251622
Change-Id: Ic1f22191ed1d7e654190fde5e70bfdf3545eb5d4
TEST: Unit-tests
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java
2fafcc56fda54b1adf8b6743beaac59dbb84dfec 08-Jun-2016 Roshan Pius <rpius@google.com> WifiBackupRestore: Handle network UIDs

Don't save creatorUID element for backup/restore. All networks will be
restored with the System UID set as the creatorUID. The creator UID is
hard to preserve across backup/restore.

Also, since the creatorUID is not being backed, there are genuine cases
where the configKey mismatch might occur. So, move the |configKey|
mismatch check out of |XmlUtil| and let backup/restore & config store
handle it differently as needed.

PS: Need to also figure out if we should stop backing up all networks
not saved by settings agent (creatorUid != SYSTEM_UD). Will wait for
discussions in b/29201888 to decide on that.

BUG: 29201888
TEST: Unit-tests
Change-Id: I668281893de9260a803872c04646b5af28ee45e5
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java
e33a4bb414892435c016486585c26022cafdab68 06-Jun-2016 Roshan Pius <rpius@google.com> 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.
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java