diff options
author | Roshan Pius <rpius@google.com> | 2017-02-22 12:48:59 -0800 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2017-02-22 15:56:40 -0800 |
commit | 38a6c1ba5d461b8c7b11685c5dd2e98d9e106b55 (patch) | |
tree | 7c8b326c87c4d4b839b2ff01efd5d0385dfb53e9 /tests | |
parent | 1f5dee32716a2709ca2e1e491cbc2f09ca35a2fa (diff) |
SupplicantStaNetworkHal: Fix network extra parsing/writing
The HIDL interface doesn't need the string to have the quotes. So,
refactor the helper functions so that it parses/creates an unquoted
string. The existing socket interface will continue to use the quoted
strings.
Also,
Don't attempt to read the wpa_supplicant.conf file in legacy store migration
if HIDL is enabled.
Bug: 35663125
Test: Unit tests
Test: Migration from N to O using HIDL interface.
Change-Id: I2ee9f61f6e9f393608982952986c5dd980c998f9
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiBackupRestoreTest.java | 2 | ||||
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiConfigStoreLegacyTest.java | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiBackupRestoreTest.java b/tests/wifitests/src/com/android/server/wifi/WifiBackupRestoreTest.java index a069e4130..9c33bfee7 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiBackupRestoreTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiBackupRestoreTest.java @@ -714,7 +714,7 @@ public class WifiBackupRestoreTest { extras.put(WifiSupplicantControl.ID_STRING_KEY_CONFIG_KEY, configuration.configKey()); extras.put(WifiSupplicantControl.ID_STRING_KEY_CREATOR_UID, Integer.toString(configuration.creatorUid)); - String idString = WifiNative.createNetworkExtra(extras); + String idString = "\"" + WifiNative.createNetworkExtra(extras) + "\""; if (idString != null) { out.write(" " + "id_str=" + idString + "\n"); } diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConfigStoreLegacyTest.java b/tests/wifitests/src/com/android/server/wifi/WifiConfigStoreLegacyTest.java index 386a86d1b..5772430b4 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiConfigStoreLegacyTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiConfigStoreLegacyTest.java @@ -205,7 +205,14 @@ public class WifiConfigStoreLegacyTest { private Map<String, WifiConfiguration> createWpaSupplicantLoadData( List<WifiConfiguration> configurations) { - List<WifiConfiguration> newConfigurations = createMaskedWifiConfigurations(configurations); + List<WifiConfiguration> newConfigurations; + // When HIDL is enabled, all the config params are directly read from the HIDL interface, + // no need to read masked variables from wpa_supplicant.conf file. + if (WifiNative.HIDL_SUP_ENABLE) { + newConfigurations = configurations; + } else { + newConfigurations = createMaskedWifiConfigurations(configurations); + } Map<String, WifiConfiguration> configurationMap = new HashMap<>(); for (WifiConfiguration config : newConfigurations) { configurationMap.put(config.configKey(true), config); |