summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--service/java/com/android/server/wifi/aware/WifiAwareNativeApi.java4
-rw-r--r--tests/wifitests/src/com/android/server/wifi/aware/WifiAwareNativeApiTest.java26
2 files changed, 24 insertions, 6 deletions
diff --git a/service/java/com/android/server/wifi/aware/WifiAwareNativeApi.java b/service/java/com/android/server/wifi/aware/WifiAwareNativeApi.java
index cccbbf697..d016b98d2 100644
--- a/service/java/com/android/server/wifi/aware/WifiAwareNativeApi.java
+++ b/service/java/com/android/server/wifi/aware/WifiAwareNativeApi.java
@@ -111,12 +111,12 @@ public class WifiAwareNativeApi implements WifiAwareShellCommand.DelegatedShellC
/* package */ static final String POWER_PARAM_IDLE_KEY = "idle";
/* package */ static final String PARAM_DW_24GHZ = "dw_24ghz";
- private static final int PARAM_DW_24GHZ_DEFAULT = -1; // Firmware default
+ private static final int PARAM_DW_24GHZ_DEFAULT = 1; // 1 -> DW=1, latency=512ms
private static final int PARAM_DW_24GHZ_INACTIVE = 4; // 4 -> DW=8, latency=4s
private static final int PARAM_DW_24GHZ_IDLE = 4; // == inactive
/* package */ static final String PARAM_DW_5GHZ = "dw_5ghz";
- private static final int PARAM_DW_5GHZ_DEFAULT = -1; // Firmware default
+ private static final int PARAM_DW_5GHZ_DEFAULT = 1; // 1 -> DW=1, latency=512ms
private static final int PARAM_DW_5GHZ_INACTIVE = 0; // 0 = disabled
private static final int PARAM_DW_5GHZ_IDLE = 0; // == inactive
diff --git a/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareNativeApiTest.java b/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareNativeApiTest.java
index 6fe855666..1be56cc9e 100644
--- a/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareNativeApiTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareNativeApiTest.java
@@ -145,16 +145,25 @@ public class WifiAwareNativeApiTest {
*/
@Test
public void testEnableAndConfigPowerSettingsDefaults() throws RemoteException {
+ byte default5 = 1;
+ byte default24 = 1;
+
Pair<NanConfigRequest, NanConfigRequestSupplemental> configs =
validateEnableAndConfigure((short) 10, new ConfigRequest.Builder().build(), true,
true, true, false, false);
- collector.checkThat("validDiscoveryWindowIntervalVal-5", false,
+ collector.checkThat("validDiscoveryWindowIntervalVal-5", true,
equalTo(configs.first.bandSpecificConfig[NanBandIndex.NAN_BAND_5GHZ]
.validDiscoveryWindowIntervalVal));
- collector.checkThat("validDiscoveryWindowIntervalVal-24", false,
+ collector.checkThat("validDiscoveryWindowIntervalVal-24", true,
equalTo(configs.first.bandSpecificConfig[NanBandIndex.NAN_BAND_24GHZ]
.validDiscoveryWindowIntervalVal));
+ collector.checkThat("discoveryWindowIntervalVal-5", default5,
+ equalTo(configs.first.bandSpecificConfig[NanBandIndex.NAN_BAND_5GHZ]
+ .discoveryWindowIntervalVal));
+ collector.checkThat("discoveryWindowIntervalVal-24", default24,
+ equalTo(configs.first.bandSpecificConfig[NanBandIndex.NAN_BAND_24GHZ]
+ .discoveryWindowIntervalVal));
}
/**
@@ -218,16 +227,25 @@ public class WifiAwareNativeApiTest {
*/
@Test
public void testEnableAndConfigPowerSettingsDefaults_1_2() throws RemoteException {
+ byte default5 = 1;
+ byte default24 = 1;
+
Pair<NanConfigRequest, NanConfigRequestSupplemental> configs =
validateEnableAndConfigure((short) 10, new ConfigRequest.Builder().build(), true,
true, true, false, true);
- collector.checkThat("validDiscoveryWindowIntervalVal-5", false,
+ collector.checkThat("validDiscoveryWindowIntervalVal-5", true,
equalTo(configs.first.bandSpecificConfig[NanBandIndex.NAN_BAND_5GHZ]
.validDiscoveryWindowIntervalVal));
- collector.checkThat("validDiscoveryWindowIntervalVal-24", false,
+ collector.checkThat("validDiscoveryWindowIntervalVal-24", true,
equalTo(configs.first.bandSpecificConfig[NanBandIndex.NAN_BAND_24GHZ]
.validDiscoveryWindowIntervalVal));
+ collector.checkThat("discoveryWindowIntervalVal-5", default5,
+ equalTo(configs.first.bandSpecificConfig[NanBandIndex.NAN_BAND_5GHZ]
+ .discoveryWindowIntervalVal));
+ collector.checkThat("discoveryWindowIntervalVal-24", default24,
+ equalTo(configs.first.bandSpecificConfig[NanBandIndex.NAN_BAND_24GHZ]
+ .discoveryWindowIntervalVal));
collector.checkThat("discoveryBeaconIntervalMs", 0,
equalTo(configs.second.discoveryBeaconIntervalMs));