summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2016-12-13 09:38:40 -0800
committerRoshan Pius <rpius@google.com>2016-12-13 09:41:43 -0800
commit1b76ca405029249b41b38424a253a8c5fa72dab1 (patch)
tree57e0af7d64feab51ba31bfa74b89167d0ac8bdc0 /service
parentd0258ee4816148ff4ab9ac6b854fc5c51ea53be3 (diff)
WifiScanninService: Reject bgscan requests on invalid caps
Reject any bgscan requests if the HAL returns invalid capabilities at startup. Bug: 33566846 Test: Added unit test. Change-Id: I1a6a986194dd0da2ef139f13307657aafd67b4e4
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java b/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
index 68c917ffd..8846fe3a4 100644
--- a/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
+++ b/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
@@ -1002,6 +1002,11 @@ public class WifiScanningServiceImpl extends IWifiScanner.Stub {
loge("could not get scan capabilities");
return HANDLED;
}
+ if (capabilities.max_scan_buckets <= 0) {
+ loge("invalid max buckets in scan capabilities "
+ + capabilities.max_scan_buckets);
+ return HANDLED;
+ }
mBackgroundScheduler.setMaxBuckets(capabilities.max_scan_buckets);
mBackgroundScheduler.setMaxApPerScan(capabilities.max_ap_cache_per_scan);