summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2017-04-12 22:58:45 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-04-12 22:58:45 +0000
commit6ac4be51565b2c0de7ee4928104692b19111910c (patch)
tree91eb6207eedfdd3eb093d3b73381b3e95a964342 /tests
parentfd04dc2ac414fe830299b23dfcdcabc25430baf6 (diff)
parent6055a6d756f131a052395b851129e174e412fb80 (diff)
Merge "Make the NetworkSpecifier a class instead of a string." am: 8c8188a1e8 am: adc933f525
am: 6055a6d756 Change-Id: I9a52ccc70177a86d70cb8f24246109672837875c
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/aware/WifiAwareDataPathStateManagerTest.java11
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);