From c06efae309a47fe7cd22d0b1dcb616112e1b5be0 Mon Sep 17 00:00:00 2001 From: Nalla Kartheek Date: Wed, 23 Dec 2015 19:32:01 +0530 Subject: Wifi: Add NULL check before processing gscan results WifiScanningService shall query the gscan results through WiFiNative's getScanResults API, which shall return NULL, if isHalStarted fails. Since, WiFiService and WiFiScanningService run in different contexts, a query for the gscan results shall happen while the WiFi is disabled(setWifiEnabled == FALSE). This would result in a NULL being returned by getScanResults API. Hence the check. Change-Id: Icf9e37aca568e23a26a5301434adcde6af7512ab CRs-Fixed: 936628 --- service/java/com/android/server/wifi/WifiScanningServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/service/java/com/android/server/wifi/WifiScanningServiceImpl.java b/service/java/com/android/server/wifi/WifiScanningServiceImpl.java index 9038b4eec..a2ff1d8d8 100644 --- a/service/java/com/android/server/wifi/WifiScanningServiceImpl.java +++ b/service/java/com/android/server/wifi/WifiScanningServiceImpl.java @@ -445,6 +445,10 @@ public class WifiScanningServiceImpl extends IWifiScanner.Stub { break; case CMD_SCAN_RESULTS_AVAILABLE: { ScanData[] results = WifiNative.getScanResults(/* flush = */ true); + if (results == null) { + loge("Wifi HAL SCAN results NULL"); + break; + } Collection clients = mClients.values(); for (ClientInfo ci2 : clients) { ci2.reportScanResults(results); -- cgit v1.2.3