diff options
author | Robert Greenwalt <rgreenwalt@google.com> | 2013-09-22 15:59:00 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-09-22 15:59:01 +0000 |
commit | 0983eadff23bfc3ab7812be455d4a66edc3dcc7b (patch) | |
tree | 43deae857670f87fa4b678df261cc19e9a9f8652 /wifi/java | |
parent | ca833c389b3cc2f95f27fe7782d0bebb8b36d660 (diff) | |
parent | 13820af302ead6b6a17b5f1b3991fcf8af252f93 (diff) | |
download | frameworks_base-0983eadff23bfc3ab7812be455d4a66edc3dcc7b.zip frameworks_base-0983eadff23bfc3ab7812be455d4a66edc3dcc7b.tar.gz frameworks_base-0983eadff23bfc3ab7812be455d4a66edc3dcc7b.tar.bz2 |
Merge "Fix BatchScan request coalesing" into klp-dev
Diffstat (limited to 'wifi/java')
-rw-r--r-- | wifi/java/android/net/wifi/BatchedScanSettings.java | 36 |
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; |