summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorMitchell Wills <mwills@google.com>2016-09-12 21:18:01 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-09-12 21:18:01 +0000
commitc6499c03ffeddecb4cda5df79c69e0d0a7677f9a (patch)
treef4ddcf9ba649c4bfd2c1b2be8681e5b7c471299b /service
parent8440999dcfbe198a0e4031714bfdc27c78aeedaa (diff)
parent4e1f32efceee1db37bfb1e2624b434dbfb055686 (diff)
Add a flag to indicate if a ScanData is for a scan for all channels
am: 4e1f32efce Change-Id: I2bf308cfd12827d268913954da139e7ed0bac288
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/scanner/ChannelHelper.java4
-rw-r--r--service/java/com/android/server/wifi/scanner/KnownBandsChannelHelper.java6
-rw-r--r--service/java/com/android/server/wifi/scanner/NoBandChannelHelper.java5
-rw-r--r--service/java/com/android/server/wifi/scanner/SupplicantWifiScannerImpl.java3
4 files changed, 17 insertions, 1 deletions
diff --git a/service/java/com/android/server/wifi/scanner/ChannelHelper.java b/service/java/com/android/server/wifi/scanner/ChannelHelper.java
index d4168123d..acb0ac820 100644
--- a/service/java/com/android/server/wifi/scanner/ChannelHelper.java
+++ b/service/java/com/android/server/wifi/scanner/ChannelHelper.java
@@ -100,6 +100,10 @@ public abstract class ChannelHelper {
*/
public abstract boolean isEmpty();
/**
+ * @return true if the collection contains all available channels
+ */
+ public abstract boolean isAllChannels();
+ /**
* Remove all channels from the collection
*/
public abstract void clear();
diff --git a/service/java/com/android/server/wifi/scanner/KnownBandsChannelHelper.java b/service/java/com/android/server/wifi/scanner/KnownBandsChannelHelper.java
index b180da71d..acddc26c6 100644
--- a/service/java/com/android/server/wifi/scanner/KnownBandsChannelHelper.java
+++ b/service/java/com/android/server/wifi/scanner/KnownBandsChannelHelper.java
@@ -198,6 +198,12 @@ public class KnownBandsChannelHelper extends ChannelHelper {
}
@Override
+ public boolean isAllChannels() {
+ return getAvailableScanChannels(WifiScanner.WIFI_BAND_BOTH_WITH_DFS).length ==
+ mChannels.size();
+ }
+
+ @Override
public void clear() {
mAllBands = 0;
mExactBands = 0;
diff --git a/service/java/com/android/server/wifi/scanner/NoBandChannelHelper.java b/service/java/com/android/server/wifi/scanner/NoBandChannelHelper.java
index 7b1602008..4f8373b30 100644
--- a/service/java/com/android/server/wifi/scanner/NoBandChannelHelper.java
+++ b/service/java/com/android/server/wifi/scanner/NoBandChannelHelper.java
@@ -112,6 +112,11 @@ public class NoBandChannelHelper extends ChannelHelper {
}
@Override
+ public boolean isAllChannels() {
+ return mAllChannels;
+ }
+
+ @Override
public void clear() {
mAllChannels = false;
mChannels.clear();
diff --git a/service/java/com/android/server/wifi/scanner/SupplicantWifiScannerImpl.java b/service/java/com/android/server/wifi/scanner/SupplicantWifiScannerImpl.java
index 4554d20e7..f0cac0fb6 100644
--- a/service/java/com/android/server/wifi/scanner/SupplicantWifiScannerImpl.java
+++ b/service/java/com/android/server/wifi/scanner/SupplicantWifiScannerImpl.java
@@ -637,7 +637,8 @@ public class SupplicantWifiScannerImpl extends WifiScannerImpl implements Handle
}
}
Collections.sort(singleScanResults, SCAN_RESULT_SORT_COMPARATOR);
- mLatestSingleScanResult = new WifiScanner.ScanData(mLastScanSettings.scanId, 0,
+ mLatestSingleScanResult = new WifiScanner.ScanData(mLastScanSettings.scanId, 0, 0,
+ mLastScanSettings.singleScanFreqs.isAllChannels(),
singleScanResults.toArray(new ScanResult[singleScanResults.size()]));
mLastScanSettings.singleScanEventHandler
.onScanStatus(WifiNative.WIFI_SCAN_RESULTS_AVAILABLE);