diff options
author | c_rrajiv <rrajiv@codeaurora.org> | 2015-03-25 12:12:29 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2015-10-28 15:35:02 -0700 |
commit | e6dbe48b7f4bfb46ab442547897b1212694ffcfc (patch) | |
tree | 81030a1ee7cdea51babe10b1786a645c04b9c995 /service/java | |
parent | ac45f8073f6ad18ca758092932e44ea77b159a53 (diff) | |
download | android_frameworks_opt_net_wifi-e6dbe48b7f4bfb46ab442547897b1212694ffcfc.tar.gz android_frameworks_opt_net_wifi-e6dbe48b7f4bfb46ab442547897b1212694ffcfc.tar.bz2 android_frameworks_opt_net_wifi-e6dbe48b7f4bfb46ab442547897b1212694ffcfc.zip |
wifi: Handle the NULL check for the STATUS command
STATUS command is issued to the supplicant to get the currently connected
network status. The current code does not consider the failure scenario
(NULL check) for the obtained response and this commit handles the same.
Change-Id: I4d90386bf8d909c97cacdf5b9c80e07a679d63ee
CRs-Fixed: 930365
Diffstat (limited to 'service/java')
-rw-r--r-- | service/java/com/android/server/wifi/WifiAutoJoinController.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WifiAutoJoinController.java b/service/java/com/android/server/wifi/WifiAutoJoinController.java index 800fc4773..58e15a03e 100644 --- a/service/java/com/android/server/wifi/WifiAutoJoinController.java +++ b/service/java/com/android/server/wifi/WifiAutoJoinController.java @@ -1365,6 +1365,13 @@ public class WifiAutoJoinController { logDbg("attemptAutoJoin() status=" + wpaStatus); } + if (wpaStatus == null) { + if (VDBG) { + logDbg("wpaStatus is null"); + } + return WifiConfiguration.INVALID_NETWORK_ID; + } + try { int id = WifiConfiguration.INVALID_NETWORK_ID; String state = null; @@ -1526,6 +1533,12 @@ public class WifiAutoJoinController { // Find the currently connected network: ask the supplicant directly int supplicantNetId = getNetID(mWifiNative.status(true)); + if (supplicantNetId == WifiConfiguration.INVALID_NETWORK_ID) { + if (VDBG) { + logDbg("attemptAutoJoin getNetID returned invalid supplicantNetId"); + } + return false; + } if (DBG) { String conf = ""; |