summaryrefslogtreecommitdiffstats
path: root/service/java/com/android/server/wifi/scanner
diff options
context:
space:
mode:
authorMitchell Wills <mwills@google.com>2016-05-16 14:55:39 -0700
committerMitchell Wills <mwills@google.com>2016-05-17 13:35:57 -0700
commitf5cdd8e7a6b7d4c0b5f77134273c7e894d8c087b (patch)
tree0cb2cf5f55b8fe93a55a4b4bffec7298e4dd0cd4 /service/java/com/android/server/wifi/scanner
parent6b838f693ae0635b8f513d14725e54efadc29977 (diff)
downloadandroid_frameworks_opt_net_wifi-f5cdd8e7a6b7d4c0b5f77134273c7e894d8c087b.tar.gz
android_frameworks_opt_net_wifi-f5cdd8e7a6b7d4c0b5f77134273c7e894d8c087b.tar.bz2
android_frameworks_opt_net_wifi-f5cdd8e7a6b7d4c0b5f77134273c7e894d8c087b.zip
Fix crash when scanner gets results that don't match the request
Before this, when WifiScanningService processed single scan results from supplicant that only contained results that did not match a request the filter code would return null indicating that the results should not be delivered, causing a NPE later. This change updates the meaning of the bucket index that the single scan code provides to the filtering code to instead force it to always include scan results. Change-Id: I65cd57b14abacec3f407991188c570601d05ac77 Fixes: 28794598
Diffstat (limited to 'service/java/com/android/server/wifi/scanner')
-rw-r--r--service/java/com/android/server/wifi/scanner/ScanScheduleUtil.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/service/java/com/android/server/wifi/scanner/ScanScheduleUtil.java b/service/java/com/android/server/wifi/scanner/ScanScheduleUtil.java
index 01418b91c..9267aa0f5 100644
--- a/service/java/com/android/server/wifi/scanner/ScanScheduleUtil.java
+++ b/service/java/com/android/server/wifi/scanner/ScanScheduleUtil.java
@@ -94,7 +94,8 @@ public class ScanScheduleUtil {
* Check if the specified bucket was scanned. If not all information is available then this
* method will return true.
*
- * @param scheduledBucket Index of the bucket to check for, zero indexed, or -1 if unavailable
+ * @param scheduledBucket Index of the bucket to check for, zero indexed, or -1 if any scan
+ * should be treated as scanning this bucket.
* @param bucketsScannedBitSet The bitset of all buckets scanned, 0 if unavailable
*/
private static boolean isBucketMaybeScanned(int scheduledBucket, int bucketsScannedBitSet) {
@@ -109,11 +110,14 @@ public class ScanScheduleUtil {
* Check if the specified bucket was scanned. If not all information is available then this
* method will return false.
*
- * @param scheduledBucket Index of the bucket to check for, zero indexed, or -1 if unavailable
+ * @param scheduledBucket Index of the bucket to check for, zero indexed, or -1 if any scan
+ * should be treated as scanning this bucket.
* @param bucketsScannedBitSet The bitset of all buckets scanned, 0 if unavailable
*/
private static boolean isBucketDefinitlyScanned(int scheduledBucket, int bucketsScannedBitSet) {
- if (bucketsScannedBitSet == 0 || scheduledBucket < 0) {
+ if (scheduledBucket < 0) {
+ return true;
+ } else if (bucketsScannedBitSet == 0) {
return false;
} else {
return (bucketsScannedBitSet & (1 << scheduledBucket)) != 0;