summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEtan Cohen <etancohen@google.com>2017-03-20 11:35:55 -0700
committerEtan Cohen <etancohen@google.com>2017-03-28 11:42:12 -0700
commit16b00750e1d3c41ce9b4ccae9f07e0586e8ca2d0 (patch)
treec320c1a121892beb0601e8ae852fa1cbe32ff5f8 /tests
parent331184d17817a25263e2e731f87a3bc68bc831ef (diff)
[AWARE] Restrict publish/subscribe count configuration API
Public API access to publish/subscribe count removed. Enforce restriction on service side. Bug: 36446307 Test: unit tests and integration (sl4a) tests Change-Id: I28edd79dcf3aa1e34f921a35c388dc0b056831d0
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/aware/WifiAwareServiceImplTest.java4
-rw-r--r--tests/wifitests/src/com/android/server/wifi/aware/WifiAwareStateManagerTest.java12
2 files changed, 6 insertions, 10 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareServiceImplTest.java b/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareServiceImplTest.java
index 91fe87510..0ffb04bd2 100644
--- a/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareServiceImplTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareServiceImplTest.java
@@ -585,7 +585,7 @@ public class WifiAwareServiceImplTest {
// caught by the Builder. Want to test whether service side will catch invalidly
// constructed configs.
PublishConfig publishConfig = new PublishConfig(serviceName.getBytes(), ssi, matchFilter,
- PublishConfig.PUBLISH_TYPE_UNSOLICITED, 0, 0, true);
+ PublishConfig.PUBLISH_TYPE_UNSOLICITED, 0, true);
int clientId = doConnect();
IWifiAwareDiscoverySessionCallback mockCallback = mock(
IWifiAwareDiscoverySessionCallback.class);
@@ -601,7 +601,7 @@ public class WifiAwareServiceImplTest {
// caught by the Builder. Want to test whether service side will catch invalidly
// constructed configs.
SubscribeConfig subscribeConfig = new SubscribeConfig(serviceName.getBytes(), ssi,
- matchFilter, SubscribeConfig.SUBSCRIBE_TYPE_PASSIVE, 0, 0,
+ matchFilter, SubscribeConfig.SUBSCRIBE_TYPE_PASSIVE, 0,
SubscribeConfig.MATCH_STYLE_ALL, true);
int clientId = doConnect();
IWifiAwareDiscoverySessionCallback mockCallback = mock(
diff --git a/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareStateManagerTest.java b/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareStateManagerTest.java
index 13870c03b..2797c0e06 100644
--- a/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareStateManagerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareStateManagerTest.java
@@ -1035,7 +1035,6 @@ public class WifiAwareStateManagerTest {
final String callingPackage = "com.google.somePackage";
final String serviceName = "some-service-name";
final String ssi = "some much longer and more arbitrary data";
- final int subscribeCount = 7;
final int reasonFail = NanStatusType.INTERNAL_FAILURE;
final int subscribeId = 15;
final int requestorId = 22;
@@ -1050,7 +1049,7 @@ public class WifiAwareStateManagerTest {
SubscribeConfig subscribeConfig = new SubscribeConfig.Builder().setServiceName(serviceName)
.setServiceSpecificInfo(ssi.getBytes())
.setSubscribeType(SubscribeConfig.SUBSCRIBE_TYPE_PASSIVE)
- .setSubscribeCount(subscribeCount).build();
+ .build();
IWifiAwareEventCallback mockCallback = mock(IWifiAwareEventCallback.class);
IWifiAwareDiscoverySessionCallback mockSessionCallback = mock(
@@ -1909,7 +1908,6 @@ public class WifiAwareStateManagerTest {
final String callingPackage = "com.google.somePackage";
final String serviceName = "some-service-name";
final String ssi = "some much longer and more arbitrary data";
- final int subscribeCount = 7;
final int subscribeId = 15;
final int requestorId = 22;
final byte[] peerMac = HexEncoding.decode("060708090A0B".toCharArray(), false);
@@ -1921,7 +1919,7 @@ public class WifiAwareStateManagerTest {
SubscribeConfig subscribeConfig = new SubscribeConfig.Builder().setServiceName(serviceName)
.setServiceSpecificInfo(ssi.getBytes())
.setSubscribeType(SubscribeConfig.SUBSCRIBE_TYPE_PASSIVE)
- .setSubscribeCount(subscribeCount).build();
+ .build();
IWifiAwareEventCallback mockCallback = mock(IWifiAwareEventCallback.class);
IWifiAwareDiscoverySessionCallback mockSessionCallback = mock(
@@ -2312,7 +2310,6 @@ public class WifiAwareStateManagerTest {
final int masterPref = 111;
final String serviceName = "some-service-name";
final String ssi = "some much longer and more arbitrary data";
- final int publishCount = 7;
final int publishId = 22;
ConfigRequest configRequest = new ConfigRequest.Builder().setClusterLow(clusterLow)
@@ -2320,7 +2317,7 @@ public class WifiAwareStateManagerTest {
PublishConfig publishConfig = new PublishConfig.Builder().setServiceName(
serviceName).setServiceSpecificInfo(ssi.getBytes()).setPublishType(
- PublishConfig.PUBLISH_TYPE_UNSOLICITED).setPublishCount(publishCount).build();
+ PublishConfig.PUBLISH_TYPE_UNSOLICITED).build();
ArgumentCaptor<Short> transactionId = ArgumentCaptor.forClass(Short.class);
IWifiAwareEventCallback mockCallback = mock(IWifiAwareEventCallback.class);
@@ -2388,14 +2385,13 @@ public class WifiAwareStateManagerTest {
final int masterPref = 234;
final String serviceName = "some-service-name";
final String ssi = "some much longer and more arbitrary data";
- final int publishCount = 15;
ConfigRequest configRequest = new ConfigRequest.Builder().setClusterLow(clusterLow)
.setClusterHigh(clusterHigh).setMasterPreference(masterPref).build();
PublishConfig publishConfig = new PublishConfig.Builder().setServiceName(
serviceName).setServiceSpecificInfo(ssi.getBytes()).setPublishType(
- PublishConfig.PUBLISH_TYPE_UNSOLICITED).setPublishCount(publishCount).build();
+ PublishConfig.PUBLISH_TYPE_UNSOLICITED).build();
ArgumentCaptor<Short> transactionId = ArgumentCaptor.forClass(Short.class);
IWifiAwareEventCallback mockCallback = mock(IWifiAwareEventCallback.class);