summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRockchip2015-08-26 10:42:29 +0800
committerRockchip2015-08-26 10:42:29 +0800
commit0339ff3ccf7aec6556cc347216c980828660b75f (patch)
tree3ecf658fed22d0b1a92baf1f7dfe4d8cd9ec6fd4
parentb374025ae5dc56da8cc9f47c2821c073bb815235 (diff)
Do gateway and dnsaddress null point check for network checker.
Signed-off-by: Rockchip <service@rock-chips.com>
-rw-r--r--service/java/com/android/server/wifi/WifiStateMachine.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java
index 37ca88d..4d380a7 100644
--- a/service/java/com/android/server/wifi/WifiStateMachine.java
+++ b/service/java/com/android/server/wifi/WifiStateMachine.java
@@ -1233,6 +1233,10 @@ public class WifiStateMachine extends StateMachine {
String dns = null;
DhcpResults mDhcpResult = syncGetDhcpResults();
if (mDhcpResult != null) {
+ if (mDhcpResult.gateway == null || mDhcpResult.dnsServers == null) {
+ loge("gateway || dnsServers == null, turn off network checker.");
+ return;
+ }
String s = mDhcpResult.gateway.toString();
int space = s.indexOf('/');
gateway = s.substring(space + 1);