summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEtan Cohen <etancohen@google.com>2017-06-02 16:36:36 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-06-02 16:36:38 +0000
commitc2d50aed7d8bc49a079e28ead3ea24b4b6fd1e1b (patch)
tree90d39685cdbf7a7dd1d0a1d939c7e696531fea19
parent4b75a72b3ef6d8f5dc8b01ebad0e79f74b1d82b4 (diff)
parent9fc0418bd441b14c465c3fe35e07bceac10208be (diff)
Merge "[AWARE] Delegate channel selection to HAL"
-rw-r--r--service/java/com/android/server/wifi/aware/WifiAwareDataPathStateManager.java5
-rw-r--r--tests/wifitests/src/com/android/server/wifi/aware/WifiAwareDataPathStateManagerTest.java4
2 files changed, 5 insertions, 4 deletions
diff --git a/service/java/com/android/server/wifi/aware/WifiAwareDataPathStateManager.java b/service/java/com/android/server/wifi/aware/WifiAwareDataPathStateManager.java
index aebc37c72..aa1771c60 100644
--- a/service/java/com/android/server/wifi/aware/WifiAwareDataPathStateManager.java
+++ b/service/java/com/android/server/wifi/aware/WifiAwareDataPathStateManager.java
@@ -639,7 +639,7 @@ public class WifiAwareDataPathStateManager {
nnri.interfaceName = selectInterfaceForRequest(nnri);
mMgr.initiateDataPathSetup(networkSpecifier, nnri.networkSpecifier.peerId,
- NanDataPathChannelCfg.REQUEST_CHANNEL_SETUP, selectChannelForRequest(nnri),
+ NanDataPathChannelCfg.CHANNEL_NOT_REQUESTED, selectChannelForRequest(nnri),
nnri.peerDiscoveryMac, nnri.interfaceName, nnri.networkSpecifier.pmk,
nnri.networkSpecifier.passphrase, nnri.networkSpecifier.isOutOfBand());
nnri.state =
@@ -781,7 +781,8 @@ public class WifiAwareDataPathStateManager {
/**
* Select a channel for the network request.
*
- * TODO: for now simply select channel 6
+ * TODO (b/38209409): The value from this function isn't currently used - the channel selection
+ * is delegated to the HAL.
*/
private int selectChannelForRequest(AwareNetworkRequestInformation req) {
return 2437;
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 4985fe333..80e6a3ad0 100644
--- a/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareDataPathStateManagerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareDataPathStateManagerTest.java
@@ -16,7 +16,7 @@
package com.android.server.wifi.aware;
-import static android.hardware.wifi.V1_0.NanDataPathChannelCfg.REQUEST_CHANNEL_SETUP;
+import static android.hardware.wifi.V1_0.NanDataPathChannelCfg.CHANNEL_NOT_REQUESTED;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.junit.Assert.assertTrue;
@@ -606,7 +606,7 @@ public class WifiAwareDataPathStateManagerTest {
mMockLooper.dispatchAll();
inOrder.verify(mMockNative).initiateDataPath(transactionId.capture(),
eq(useDirect ? 0 : peerHandle.peerId),
- eq(REQUEST_CHANNEL_SETUP), eq(2437), eq(peerDiscoveryMac),
+ eq(CHANNEL_NOT_REQUESTED), anyInt(), eq(peerDiscoveryMac),
eq(sAwareInterfacePrefix + "0"), eq(pmk), eq(null), eq(useDirect), any());
if (immediateHalFailure) {
// short-circuit the rest of this test