summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2017-03-01 03:49:47 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-03-01 03:49:48 +0000
commit3a7ec4c5abde2d025b368bbfc5478ce3da8502af (patch)
treed6781eece2f817c77669e3828dc8da655449abf1 /service
parent858611a45c914fe8704b5f29406f3ff5642faa79 (diff)
parente4ed72d85e692f6bcb60c7d51206c8eb837c7b79 (diff)
Merge "Additional checks for NPE and corner cases."
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiNative.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/service/java/com/android/server/wifi/WifiNative.java b/service/java/com/android/server/wifi/WifiNative.java
index 0308ec6ec..f6697e61c 100644
--- a/service/java/com/android/server/wifi/WifiNative.java
+++ b/service/java/com/android/server/wifi/WifiNative.java
@@ -499,6 +499,10 @@ public class WifiNative {
*/
public boolean p2pListNetworks(WifiP2pGroupList groups) {
String networks = doStringCommand("LIST_NETWORKS");
+ if (networks == null) {
+ logDbg("Could not fetch list of available networks.");
+ return false;
+ }
String[] lines = networks.split("\n");
if (lines == null) return false;
boolean modified = false;
@@ -517,7 +521,7 @@ public class WifiNative {
try {
netId = Integer.parseInt(result[0]);
} catch (NumberFormatException e) {
- e.printStackTrace();
+ Log.e(TAG, "Could not parse network id " + result[0], e);
continue;
}