Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f6577d03 authored by Benedict Wong's avatar Benedict Wong Committed by Automerger Merge Worker
Browse files

Merge "Add null pointer check for mConfig in onSessionLost" am: 9fe8fcdb am:...

Merge "Add null pointer check for mConfig in onSessionLost" am: 9fe8fcdb am: 2527e8e2 am: 7b894e32

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1675749

Change-Id: I22101e585fc93c1fdb77bb7e3774255856ebf6f1
parents fe8334c1 7b894e32
Loading
Loading
Loading
Loading
+13 −11
Original line number Diff line number Diff line
@@ -2698,22 +2698,24 @@ public class Vpn {
                // prevent the NetworkManagementEventObserver from killing this VPN based on the
                // interface going down (which we expect).
                mInterface = null;
                if (mConfig != null) {
                    mConfig.interfaze = null;

                    // 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);

                        mConfig.routes.clear();
                        for (final RouteInfo route : oldRoutes) {
                        mConfig.routes.add(new RouteInfo(route.getDestination(), null /*gateway*/,
                                null /*iface*/, RTN_UNREACHABLE));
                            mConfig.routes.add(new RouteInfo(route.getDestination(),
                                    null /*gateway*/, null /*iface*/, RTN_UNREACHABLE));
                        }
                        if (mNetworkAgent != null) {
                            mNetworkAgent.sendLinkProperties(makeLinkProperties());
                        }
                    }
                }
            }

            resetIkeState();
        }