summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorAleks Rozman <arozman@google.com>2017-09-07 01:50:01 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-09-07 01:50:01 +0000
commitfb9027f89709281b4c7c2573f86dcd28ceeaea35 (patch)
treef8044c28ce0c4f6d1cd632229f66ff29021edec7 /service
parente97e21f1f14e4ef16dd5d675b17615aef3a80301 (diff)
parent1e779938f23cb1f26f028abcd3162694beb01dd0 (diff)
Handle a condition when the result of getting configured networks returns null am: 3abc7f0561 am: 3b17189719
am: 1e779938f2 Change-Id: I29953e283339c00ddbfcfb6e23ef2c0690551285
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiStateMachine.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java
index 3649f8f4c..bf5d08b09 100644
--- a/service/java/com/android/server/wifi/WifiStateMachine.java
+++ b/service/java/com/android/server/wifi/WifiStateMachine.java
@@ -1883,9 +1883,13 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiRss
public List<WifiConfiguration> syncGetConfiguredNetworks(int uuid, AsyncChannel channel) {
Message resultMsg = channel.sendMessageSynchronously(CMD_GET_CONFIGURED_NETWORKS, uuid);
- List<WifiConfiguration> result = (List<WifiConfiguration>) resultMsg.obj;
- resultMsg.recycle();
- return result;
+ if (resultMsg == null) { // an error has occurred
+ return null;
+ } else {
+ List<WifiConfiguration> result = (List<WifiConfiguration>) resultMsg.obj;
+ resultMsg.recycle();
+ return result;
+ }
}
public List<WifiConfiguration> syncGetPrivilegedConfiguredNetwork(AsyncChannel channel) {