summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorMitchell Wills <mwills@google.com>2016-06-10 13:18:09 -0700
committerMitchell Wills <mwills@google.com>2016-06-10 13:28:34 -0700
commit3040b86393a04bc939a5a94cda4169b0293dfac7 (patch)
tree1d35f378f578d8493b3656bb53b75a7a90fe8cb6 /service
parent11bb0926a6cc3380f2217532fefb9605a1fdc9e8 (diff)
Fix crash when cleaning up WifiScanner client before Wifi enabled
Change-Id: Ia212840fcf781740d5e185d3e3c2e30a477e25f0 Fixes: 29250616
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java9
1 files changed, 9 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 5c085432a..d279482ff 100644
--- a/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
+++ b/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
@@ -1095,6 +1095,10 @@ public class WifiScanningServiceImpl extends IWifiScanner.Stub {
}
private boolean updateSchedule() {
+ if (mChannelHelper == null || mBackgroundScheduler == null || mScannerImpl == null) {
+ loge("Failed to update schedule because WifiScanningService is not initialized");
+ return false;
+ }
mChannelHelper.updateChannels();
Collection<ScanSettings> settings = mActiveBackgroundScans.getAllSettings();
@@ -1221,6 +1225,11 @@ public class WifiScanningServiceImpl extends IWifiScanner.Stub {
}
private void resetHotlist() {
+ if (mScannerImpl == null) {
+ loge("Failed to update hotlist because WifiScanningService is not initialized");
+ return;
+ }
+
Collection<WifiScanner.HotlistSettings> settings =
mActiveHotlistSettings.getAllSettings();
int num_hotlist_ap = 0;