summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2017-09-01 12:47:25 -0600
committerJeff Sharkey <jsharkey@android.com>2017-09-01 12:47:32 -0600
commit7e7d6e549805108fb112b073b2af50ef42607b33 (patch)
tree6427b6b7e774593ea23a3564ec22fd1dc49f8166 /service
parentd2c7a6041bbdf91d3cedbcb16ca06d37f449d95a (diff)
Avoid NPEs when WifiNetworkAgent undefined.
Test: builds, boots Bug: 65289840 Change-Id: I9d8ba18c1137d7679d4f4ea24f86a9747bef2ca7
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiStateMachine.java18
1 files changed, 13 insertions, 5 deletions
diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java
index f1ca17dfd..b950cf254 100644
--- a/service/java/com/android/server/wifi/WifiStateMachine.java
+++ b/service/java/com/android/server/wifi/WifiStateMachine.java
@@ -5532,7 +5532,9 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiRss
result.setSignalStrength(NetworkCapabilities.SIGNAL_STRENGTH_UNSPECIFIED);
}
- mNetworkAgent.sendNetworkCapabilities(result);
+ if (mNetworkAgent != null) {
+ mNetworkAgent.sendNetworkCapabilities(result);
+ }
}
/**
@@ -6147,7 +6149,9 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiRss
if (mVerboseLoggingEnabled) {
log("explictlySelected acceptUnvalidated=" + config.noInternetAccessExpected);
}
- mNetworkAgent.explicitlySelected(config.noInternetAccessExpected);
+ if (mNetworkAgent != null) {
+ mNetworkAgent.explicitlySelected(config.noInternetAccessExpected);
+ }
}
}
@@ -6519,13 +6523,17 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiRss
dstMac = NativeUtil.macAddressToByteArray(dstMacStr);
} catch (NullPointerException | IllegalArgumentException e) {
loge("Can't find MAC address for next hop to " + pkt.dstAddress);
- mNetworkAgent.onPacketKeepaliveEvent(slot,
- ConnectivityManager.PacketKeepalive.ERROR_INVALID_IP_ADDRESS);
+ if (mNetworkAgent != null) {
+ mNetworkAgent.onPacketKeepaliveEvent(slot,
+ ConnectivityManager.PacketKeepalive.ERROR_INVALID_IP_ADDRESS);
+ }
break;
}
pkt.dstMac = dstMac;
int result = startWifiIPPacketOffload(slot, pkt, intervalSeconds);
- mNetworkAgent.onPacketKeepaliveEvent(slot, result);
+ if (mNetworkAgent != null) {
+ mNetworkAgent.onPacketKeepaliveEvent(slot, result);
+ }
break;
}
default: