summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEtan Cohen <etancohen@google.com>2016-08-23 02:34:14 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-08-23 02:34:14 +0000
commitc410715d5686f72ae9c41eb85a93b48a81fa8b64 (patch)
tree929ba63e4129da4847afeca0bfbdae52a555a536
parentd792e1b8cf0d53c9e892f9e99bf88f7385bea6f1 (diff)
parent58d41e915aac9f1f4bab51ca1fc1dec604b6a522 (diff)
[NAN] API changes/fixes addressing apilint issues
am: 58d41e915a Change-Id: Id5cc355d4b356a1272b7a5388e4c4960684efb0c
-rw-r--r--service/java/com/android/server/wifi/nan/WifiNanServiceImpl.java2
-rw-r--r--service/java/com/android/server/wifi/nan/WifiNanStateManager.java2
-rw-r--r--tests/wifitests/src/com/android/server/wifi/nan/WifiNanDataPathStateManagerTest.java4
-rw-r--r--tests/wifitests/src/com/android/server/wifi/nan/WifiNanManagerTest.java14
-rw-r--r--tests/wifitests/src/com/android/server/wifi/nan/WifiNanStateManagerTest.java2
5 files changed, 12 insertions, 12 deletions
diff --git a/service/java/com/android/server/wifi/nan/WifiNanServiceImpl.java b/service/java/com/android/server/wifi/nan/WifiNanServiceImpl.java
index 4600318e0..d7f907b27 100644
--- a/service/java/com/android/server/wifi/nan/WifiNanServiceImpl.java
+++ b/service/java/com/android/server/wifi/nan/WifiNanServiceImpl.java
@@ -334,7 +334,7 @@ public class WifiNanServiceImpl extends IWifiNanManager.Stub {
enforceAccessPermission();
enforceChangePermission();
- if (retryCount < 0 || retryCount > WifiNanSession.MAX_SEND_RETRY_COUNT) {
+ if (retryCount < 0 || retryCount > WifiNanSession.getMaxSendRetryCount()) {
throw new IllegalArgumentException("Invalid 'retryCount' must be non-negative "
+ "and <= WifiNanSession.MAX_SEND_RETRY_COUNT");
}
diff --git a/service/java/com/android/server/wifi/nan/WifiNanStateManager.java b/service/java/com/android/server/wifi/nan/WifiNanStateManager.java
index 04f726868..ac2c0c9a3 100644
--- a/service/java/com/android/server/wifi/nan/WifiNanStateManager.java
+++ b/service/java/com/android/server/wifi/nan/WifiNanStateManager.java
@@ -1722,7 +1722,7 @@ public class WifiNanStateManager {
if (VDBG) {
Log.v(TAG, "sendNanStateChangedBroadcast: enabled=" + enabled);
}
- final Intent intent = new Intent(WifiNanManager.WIFI_NAN_STATE_CHANGED_ACTION);
+ final Intent intent = new Intent(WifiNanManager.ACTION_WIFI_NAN_STATE_CHANGED);
intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY);
if (enabled) {
intent.putExtra(WifiNanManager.EXTRA_WIFI_STATE, WifiNanManager.WIFI_NAN_STATE_ENABLED);
diff --git a/tests/wifitests/src/com/android/server/wifi/nan/WifiNanDataPathStateManagerTest.java b/tests/wifitests/src/com/android/server/wifi/nan/WifiNanDataPathStateManagerTest.java
index 839b5e815..574584a80 100644
--- a/tests/wifitests/src/com/android/server/wifi/nan/WifiNanDataPathStateManagerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/nan/WifiNanDataPathStateManagerTest.java
@@ -607,7 +607,7 @@ public class WifiNanDataPathStateManagerTest {
when(mMockNanService.connect(any(IBinder.class), anyString(),
any(IWifiNanEventCallback.class), any(ConfigRequest.class))).thenReturn(clientId);
- mgr.connect(mMockLooper.getLooper(), mockCallback, configRequest);
+ mgr.connect(mMockLooper.getLooper(), configRequest, mockCallback);
verify(mMockNanService).connect(any(IBinder.class), anyString(),
clientProxyCallback.capture(), eq(configRequest));
clientProxyCallback.getValue().onConnectSuccess();
@@ -648,7 +648,7 @@ public class WifiNanDataPathStateManagerTest {
when(mMockNanService.connect(any(IBinder.class), anyString(),
any(IWifiNanEventCallback.class), any(ConfigRequest.class))).thenReturn(clientId);
- mgr.connect(mMockLooper.getLooper(), mockCallback, configRequest);
+ mgr.connect(mMockLooper.getLooper(), configRequest, mockCallback);
verify(mMockNanService).connect(any(IBinder.class), anyString(),
clientProxyCallback.capture(), eq(configRequest));
clientProxyCallback.getValue().onConnectSuccess();
diff --git a/tests/wifitests/src/com/android/server/wifi/nan/WifiNanManagerTest.java b/tests/wifitests/src/com/android/server/wifi/nan/WifiNanManagerTest.java
index 4291b32b9..bc7d62d21 100644
--- a/tests/wifitests/src/com/android/server/wifi/nan/WifiNanManagerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/nan/WifiNanManagerTest.java
@@ -296,7 +296,7 @@ public class WifiNanManagerTest {
.forClass(WifiNanPublishSession.class);
// (0) connect + success
- mDut.connect(mMockLooper.getLooper(), mockCallback, configRequest);
+ mDut.connect(mMockLooper.getLooper(), configRequest, mockCallback);
inOrder.verify(mockNanService).connect(any(IBinder.class), anyString(),
clientProxyCallback.capture(), eq(configRequest));
clientProxyCallback.getValue().onConnectSuccess();
@@ -375,7 +375,7 @@ public class WifiNanManagerTest {
.forClass(WifiNanPublishSession.class);
// (1) connect successfully
- mDut.connect(mMockLooper.getLooper(), mockCallback, configRequest);
+ mDut.connect(mMockLooper.getLooper(), configRequest, mockCallback);
inOrder.verify(mockNanService).connect(any(IBinder.class), anyString(),
clientProxyCallback.capture(), eq(configRequest));
clientProxyCallback.getValue().onConnectSuccess();
@@ -430,7 +430,7 @@ public class WifiNanManagerTest {
.forClass(WifiNanSubscribeSession.class);
// (0) connect + success
- mDut.connect(mMockLooper.getLooper(), mockCallback, configRequest);
+ mDut.connect(mMockLooper.getLooper(), configRequest, mockCallback);
inOrder.verify(mockNanService).connect(any(IBinder.class), anyString(),
clientProxyCallback.capture(), eq(configRequest));
clientProxyCallback.getValue().onConnectSuccess();
@@ -509,7 +509,7 @@ public class WifiNanManagerTest {
.forClass(WifiNanSubscribeSession.class);
// (1) connect successfully
- mDut.connect(mMockLooper.getLooper(), mockCallback, configRequest);
+ mDut.connect(mMockLooper.getLooper(), configRequest, mockCallback);
inOrder.verify(mockNanService).connect(any(IBinder.class), anyString(),
clientProxyCallback.capture(), eq(configRequest));
clientProxyCallback.getValue().onConnectSuccess();
@@ -884,7 +884,7 @@ public class WifiNanManagerTest {
.forClass(RttManager.RttResult[].class);
// (1) connect successfully
- mDut.connect(mMockLooper.getLooper(), mockCallback, configRequest);
+ mDut.connect(mMockLooper.getLooper(), configRequest, mockCallback);
inOrder.verify(mockNanService).connect(any(IBinder.class), anyString(),
clientProxyCallback.capture(), eq(configRequest));
clientProxyCallback.getValue().onConnectSuccess();
@@ -958,7 +958,7 @@ public class WifiNanManagerTest {
mockPublishSession, mockRttListener);
// (1) connect successfully
- mDut.connect(mMockLooper.getLooper(), mockCallback, configRequest);
+ mDut.connect(mMockLooper.getLooper(), configRequest, mockCallback);
inOrder.verify(mockNanService).connect(any(IBinder.class), anyString(),
clientProxyCallback.capture(), eq(configRequest));
clientProxyCallback.getValue().onConnectSuccess();
@@ -1018,7 +1018,7 @@ public class WifiNanManagerTest {
mockPublishSession, mockRttListener);
// (1) connect successfully
- mDut.connect(mMockLooper.getLooper(), mockCallback, configRequest);
+ mDut.connect(mMockLooper.getLooper(), configRequest, mockCallback);
inOrder.verify(mockNanService).connect(any(IBinder.class), anyString(),
clientProxyCallback.capture(), eq(configRequest));
clientProxyCallback.getValue().onConnectSuccess();
diff --git a/tests/wifitests/src/com/android/server/wifi/nan/WifiNanStateManagerTest.java b/tests/wifitests/src/com/android/server/wifi/nan/WifiNanStateManagerTest.java
index d7b70426e..62c809bb6 100644
--- a/tests/wifitests/src/com/android/server/wifi/nan/WifiNanStateManagerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/nan/WifiNanStateManagerTest.java
@@ -2489,7 +2489,7 @@ public class WifiNanStateManagerTest {
inOrder.verify(mMockContext).sendBroadcastAsUser(intent.capture(), eq(UserHandle.ALL));
collector.checkThat("intent action", intent.getValue().getAction(),
- equalTo(WifiNanManager.WIFI_NAN_STATE_CHANGED_ACTION));
+ equalTo(WifiNanManager.ACTION_WIFI_NAN_STATE_CHANGED));
collector.checkThat("intent contains wifi status key",
intent.getValue().getExtras().containsKey(WifiNanManager.EXTRA_WIFI_STATE),
equalTo(true));