summaryrefslogtreecommitdiffstats
path: root/wifi
diff options
context:
space:
mode:
authorRobert Greenwalt <rgreenwalt@google.com>2013-09-22 09:03:20 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-09-22 09:03:20 -0700
commit7dadd1ed2f8e1820704d347044a2e36dd2ff2eac (patch)
tree287143b8f243624a1741e970aeb8b9a9997ee6af /wifi
parentb960357438c247a175c04cdcc177c32442aa94fe (diff)
parent1e690b693c2d4ee7ba04d5882f6b5889ada07e0a (diff)
downloadframeworks_base-7dadd1ed2f8e1820704d347044a2e36dd2ff2eac.zip
frameworks_base-7dadd1ed2f8e1820704d347044a2e36dd2ff2eac.tar.gz
frameworks_base-7dadd1ed2f8e1820704d347044a2e36dd2ff2eac.tar.bz2
am 1e690b69: am 0983eadf: Merge "Fix BatchScan request coalesing" into klp-dev
* commit '1e690b693c2d4ee7ba04d5882f6b5889ada07e0a': Fix BatchScan request coalesing
Diffstat (limited to 'wifi')
-rw-r--r--wifi/java/android/net/wifi/BatchedScanSettings.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/wifi/java/android/net/wifi/BatchedScanSettings.java b/wifi/java/android/net/wifi/BatchedScanSettings.java
index 44a2ab4..f7ebc17 100644
--- a/wifi/java/android/net/wifi/BatchedScanSettings.java
+++ b/wifi/java/android/net/wifi/BatchedScanSettings.java
@@ -135,6 +135,42 @@ public class BatchedScanSettings implements Parcelable {
return false;
}
+ /** @hide */
+ public void constrain() {
+ if (scanIntervalSec == UNSPECIFIED) {
+ scanIntervalSec = DEFAULT_INTERVAL_SEC;
+ } else if (scanIntervalSec < MIN_INTERVAL_SEC) {
+ scanIntervalSec = MIN_INTERVAL_SEC;
+ } else if (scanIntervalSec > MAX_INTERVAL_SEC) {
+ scanIntervalSec = MAX_INTERVAL_SEC;
+ }
+
+ if (maxScansPerBatch == UNSPECIFIED) {
+ maxScansPerBatch = DEFAULT_SCANS_PER_BATCH;
+ } else if (maxScansPerBatch < MIN_SCANS_PER_BATCH) {
+ maxScansPerBatch = MIN_SCANS_PER_BATCH;
+ } else if (maxScansPerBatch > MAX_SCANS_PER_BATCH) {
+ maxScansPerBatch = MAX_SCANS_PER_BATCH;
+ }
+
+ if (maxApPerScan == UNSPECIFIED) {
+ maxApPerScan = DEFAULT_AP_PER_SCAN;
+ } else if (maxApPerScan < MIN_AP_PER_SCAN) {
+ maxApPerScan = MIN_AP_PER_SCAN;
+ } else if (maxApPerScan > MAX_AP_PER_SCAN) {
+ maxApPerScan = MAX_AP_PER_SCAN;
+ }
+
+ if (maxApForDistance == UNSPECIFIED) {
+ maxApForDistance = DEFAULT_AP_FOR_DISTANCE;
+ } else if (maxApForDistance < MIN_AP_FOR_DISTANCE) {
+ maxApForDistance = MIN_AP_FOR_DISTANCE;
+ } else if (maxApForDistance > MAX_AP_FOR_DISTANCE) {
+ maxApForDistance = MAX_AP_FOR_DISTANCE;
+ }
+ }
+
+
@Override
public boolean equals(Object obj) {
if (obj instanceof BatchedScanSettings == false) return false;