Merge "Add null pointer check for mConfig in onSessionLost" am: 9fe8fcdb37
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1675749 Change-Id: I5c5f42e2febe9770a37ec56083bfa9d796713d50
This commit is contained in:
@@ -2696,19 +2696,21 @@ public class Vpn {
|
|||||||
// prevent the NetworkManagementEventObserver from killing this VPN based on the
|
// prevent the NetworkManagementEventObserver from killing this VPN based on the
|
||||||
// interface going down (which we expect).
|
// interface going down (which we expect).
|
||||||
mInterface = null;
|
mInterface = null;
|
||||||
mConfig.interfaze = null;
|
if (mConfig != null) {
|
||||||
|
mConfig.interfaze = null;
|
||||||
|
|
||||||
// Set as unroutable to prevent traffic leaking while the interface is down.
|
// Set as unroutable to prevent traffic leaking while the interface is down.
|
||||||
if (mConfig != null && mConfig.routes != null) {
|
if (mConfig.routes != null) {
|
||||||
final List<RouteInfo> oldRoutes = new ArrayList<>(mConfig.routes);
|
final List<RouteInfo> oldRoutes = new ArrayList<>(mConfig.routes);
|
||||||
|
|
||||||
mConfig.routes.clear();
|
mConfig.routes.clear();
|
||||||
for (final RouteInfo route : oldRoutes) {
|
for (final RouteInfo route : oldRoutes) {
|
||||||
mConfig.routes.add(new RouteInfo(route.getDestination(), null /*gateway*/,
|
mConfig.routes.add(new RouteInfo(route.getDestination(),
|
||||||
null /*iface*/, RTN_UNREACHABLE));
|
null /*gateway*/, null /*iface*/, RTN_UNREACHABLE));
|
||||||
}
|
}
|
||||||
if (mNetworkAgent != null) {
|
if (mNetworkAgent != null) {
|
||||||
mNetworkAgent.sendLinkProperties(makeLinkProperties());
|
mNetworkAgent.sendLinkProperties(makeLinkProperties());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user