diff options
author | Nate Jiang <qiangjiang@google.com> | 2019-06-06 18:16:54 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-06-06 18:16:54 -0700 |
commit | abc2f6f11a77a05f4a619e60abe004ae4ac11b8c (patch) | |
tree | 7fe7baa61c3377e8af9eea761e64dab582143092 | |
parent | 259e104ceedf399a7f1cb198e4a7a701b3c14491 (diff) | |
parent | d23921925eeb0d42497e5e4bee75b5e500d71fc0 (diff) |
Merge "[AWARE]Change default DW" into qt-dev
am: d23921925e
Change-Id: Id23acc664db17dd0228fbee136c53c172b7a9b17
-rw-r--r-- | service/java/com/android/server/wifi/aware/WifiAwareNativeApi.java | 4 | ||||
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/aware/WifiAwareNativeApiTest.java | 26 |
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)); |