summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorAleks Rozman <arozman@google.com>2017-09-07 01:45:01 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-09-07 01:45:01 +0000
commit1e779938f23cb1f26f028abcd3162694beb01dd0 (patch)
tree977c78b369abfb587d11c7e4ca61ae38fd5c4e6c /service
parent1e31a57f290a2053077e5277f1c98c0fb1d26d69 (diff)
parent3b1718971915fb7d486fa43d2888902a98f59bd1 (diff)
Handle a condition when the result of getting configured networks returns null am: 3abc7f0561
am: 3b17189719 Change-Id: I6f2c96f8ef75e97e5df867a6122ee94b0060d0ad
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 19c4812b0..ab7cd01dd 100644
--- a/service/java/com/android/server/wifi/WifiStateMachine.java
+++ b/service/java/com/android/server/wifi/WifiStateMachine.java
@@ -1843,9 +1843,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) {