summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2019-06-07 01:00:21 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-06-07 01:00:21 +0000
commitd23921925eeb0d42497e5e4bee75b5e500d71fc0 (patch)
tree7fe7baa61c3377e8af9eea761e64dab582143092
parentaf9b7b297e43fe6fe347a6143d76bde2cb2363c6 (diff)
parenta45902327a2ee77551a1a29833ab987a8dc7fd4f (diff)
Merge "[AWARE]Change default DW" into qt-dev
-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));