summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2017-09-01 21:08:43 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-09-01 21:08:43 +0000
commitb67a02500b56fb9f694382ee33fc50a3f12ccb0a (patch)
treeefeb6eb81113c189ed617bde6cd8f6e8c6e887c0 /service
parenta2dae3436431f3fe2ac79ad087fe62f6fcda8ad7 (diff)
parent7e7d6e549805108fb112b073b2af50ef42607b33 (diff)
Merge "Avoid NPEs when WifiNetworkAgent undefined." into oc-mr1-dev
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: