diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2017-04-12 22:27:35 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-04-12 22:27:37 +0000 |
commit | 8c8188a1e8b4b784d47500272135305735d1c54c (patch) | |
tree | 0aea3998dc79073ce41b9493a85a8710d2b906a7 /tests | |
parent | c258cac284560bef4d8be2abae9ff50015d5f9d0 (diff) | |
parent | b81eb91076f713e800415d26d57a8109d4f35037 (diff) |
Merge "Make the NetworkSpecifier a class instead of a string."
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/aware/WifiAwareDataPathStateManagerTest.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareDataPathStateManagerTest.java b/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareDataPathStateManagerTest.java index 29d0d12a6..912dce2f3 100644 --- a/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareDataPathStateManagerTest.java +++ b/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareDataPathStateManagerTest.java @@ -37,6 +37,7 @@ import android.net.ConnectivityManager; import android.net.NetworkCapabilities; import android.net.NetworkFactory; import android.net.NetworkRequest; +import android.net.StringNetworkSpecifier; import android.net.wifi.aware.AttachCallback; import android.net.wifi.aware.ConfigRequest; import android.net.wifi.aware.DiscoverySession; @@ -417,10 +418,12 @@ public class WifiAwareDataPathStateManagerTest { doPublish); // corrupt the network specifier: reverse the role (so it's mis-matched) - JSONObject jsonObject = new JSONObject(nr.networkCapabilities.getNetworkSpecifier()); + JSONObject jsonObject = new JSONObject( + ((StringNetworkSpecifier) nr.networkCapabilities.getNetworkSpecifier()).specifier); jsonObject.put(WifiAwareManager.NETWORK_SPECIFIER_KEY_ROLE, 1 - jsonObject.getInt(WifiAwareManager.NETWORK_SPECIFIER_KEY_ROLE)); - nr.networkCapabilities.setNetworkSpecifier(jsonObject.toString()); + nr.networkCapabilities.setNetworkSpecifier( + new StringNetworkSpecifier(jsonObject.toString())); Message reqNetworkMsg = Message.obtain(); reqNetworkMsg.what = NetworkFactory.CMD_REQUEST_NETWORK; @@ -691,7 +694,7 @@ public class WifiAwareDataPathStateManagerTest { nc.addTransportType(NetworkCapabilities.TRANSPORT_WIFI_AWARE); nc.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_VPN).addCapability( NetworkCapabilities.NET_CAPABILITY_NOT_METERED); - nc.setNetworkSpecifier(ns); + nc.setNetworkSpecifier(new StringNetworkSpecifier(ns)); nc.setLinkUpstreamBandwidthKbps(1); nc.setLinkDownstreamBandwidthKbps(1); nc.setSignalStrength(1); @@ -729,7 +732,7 @@ public class WifiAwareDataPathStateManagerTest { nc.addTransportType(NetworkCapabilities.TRANSPORT_WIFI_AWARE); nc.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_VPN).addCapability( NetworkCapabilities.NET_CAPABILITY_NOT_METERED); - nc.setNetworkSpecifier(ns); + nc.setNetworkSpecifier(new StringNetworkSpecifier(ns)); nc.setLinkUpstreamBandwidthKbps(1); nc.setLinkDownstreamBandwidthKbps(1); nc.setSignalStrength(1); |