summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchell Wills <mwills@google.com>2016-05-24 15:38:28 -0700
committerMitchell Wills <mwills@google.com>2016-05-24 17:30:30 -0700
commit1b266ec1524c516a7ebf25b76801db86427ba68b (patch)
treeee7103778d17ac92924cd96841bd5f63fdf45d95
parent5de778c46065cf6a72c2c0d124c0ac882e5b55fe (diff)
Update background scan bucket periods to align with minutes
Bug: 28320003 Change-Id: Ic551cc6d7fcaa94945d2768d7aa2cf705dd510fd
-rw-r--r--service/java/com/android/server/wifi/scanner/BackgroundScanScheduler.java21
1 files changed, 11 insertions, 10 deletions
diff --git a/service/java/com/android/server/wifi/scanner/BackgroundScanScheduler.java b/service/java/com/android/server/wifi/scanner/BackgroundScanScheduler.java
index 9632524b9..0f9243194 100644
--- a/service/java/com/android/server/wifi/scanner/BackgroundScanScheduler.java
+++ b/service/java/com/android/server/wifi/scanner/BackgroundScanScheduler.java
@@ -78,7 +78,7 @@ public class BackgroundScanScheduler {
/**
* Default period to use if no buckets are being scheduled
*/
- private static final int DEFAULT_PERIOD_MS = 40000;
+ private static final int DEFAULT_PERIOD_MS = 30000;
/**
* Scan report threshold percentage to assign to the schedule by default
* @see com.android.server.wifi.WifiNative.ScanSettings#report_threshold_percent
@@ -87,7 +87,8 @@ public class BackgroundScanScheduler {
/**
* List of predefined periods (in ms) that buckets can be scheduled at. Ordered by preference
- * if there are not enough buckets for all periods. All periods MUST be 2^N * PERIOD_MIN_GCD_MS.
+ * if there are not enough buckets for all periods. All periods MUST be an integer multiple of
+ * the next smallest bucket with the smallest bucket having a period of PERIOD_MIN_GCD_MS.
* This requirement allows scans to be scheduled more efficiently because scan requests with
* intersecting channels will result in those channels being scanned exactly once at the smaller
* period and no unnecessary scan being scheduled. If this was not the case and two requests
@@ -106,15 +107,15 @@ public class BackgroundScanScheduler {
* for each type. Regular scan requests will be packed into the remaining buckets.
*/
private static final int[] PREDEFINED_BUCKET_PERIODS = {
- 4 * PERIOD_MIN_GCD_MS, // 40s
- 2 * PERIOD_MIN_GCD_MS, // 20s
- 16 * PERIOD_MIN_GCD_MS, // 160s
- 32 * PERIOD_MIN_GCD_MS, // 320s
+ 3 * PERIOD_MIN_GCD_MS, // 30s
+ 12 * PERIOD_MIN_GCD_MS, // 120s
+ 48 * PERIOD_MIN_GCD_MS, // 480s
1 * PERIOD_MIN_GCD_MS, // 10s
- 128 * PERIOD_MIN_GCD_MS, // 1280s
- 64 * PERIOD_MIN_GCD_MS, // 640s
- 256 * PERIOD_MIN_GCD_MS, // 2560s
- 8 * PERIOD_MIN_GCD_MS, // 80s
+ 6 * PERIOD_MIN_GCD_MS, // 60s
+ 192 * PERIOD_MIN_GCD_MS, // 1920s
+ 24 * PERIOD_MIN_GCD_MS, // 240s
+ 96 * PERIOD_MIN_GCD_MS, // 960s
+ 384 * PERIOD_MIN_GCD_MS, // 3840s
-1, // place holder for exponential back off scan
};