summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorNingyuan Wang <nywang@google.com>2017-05-31 17:48:32 -0700
committerNingyuan Wang <nywang@google.com>2017-06-01 11:28:02 -0700
commite7ec898b26f04fca3390b2219965f365036b15ce (patch)
treeaa9303c5dc6759f572b2e5473c5dab0e6356fa08 /service
parente2e66be742947c65f882dd1fe6a267b1acf97001 (diff)
Report single scan failure on inconsistent event
When mLastScanSettings is set for single scan but a pno scan event comes, we should report single scan failure event, so WifiSingleScanStateMachine won't stick in ScanningState forever. Bug: 62019591 Test: compile, unittests, manual tests, integration test Change-Id: I96bcc3fedf1eeb47e662225724ead1713e1a7ce2
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/scanner/WificondScannerImpl.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/scanner/WificondScannerImpl.java b/service/java/com/android/server/wifi/scanner/WificondScannerImpl.java
index b088cc01d..05603dfd4 100644
--- a/service/java/com/android/server/wifi/scanner/WificondScannerImpl.java
+++ b/service/java/com/android/server/wifi/scanner/WificondScannerImpl.java
@@ -563,6 +563,16 @@ public class WificondScannerImpl extends WifiScannerImpl implements Handler.Call
}
mLastScanSettings.pnoScanEventHandler.onPnoNetworkFound(pnoScanResultsArray);
}
+ // On pno scan result event, we are expecting a mLastScanSettings for pno scan.
+ // However, if unlikey mLastScanSettings is for single scan, we need this part
+ // to protect from leaving WifiSingleScanStateMachine in a forever wait state.
+ if (mLastScanSettings.singleScanActive
+ && mLastScanSettings.singleScanEventHandler != null) {
+ Log.wtf(TAG, "Polling pno scan result when single scan is active, reporting"
+ + " single scan failure");
+ mLastScanSettings.singleScanEventHandler
+ .onScanStatus(WifiNative.WIFI_SCAN_FAILED);
+ }
// mLastScanSettings is for either single/batched scan or pno scan.
// We can safely set it to null when pno scan finishes.
mLastScanSettings = null;