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

Commit e8117f67 authored by Chalard Jean's avatar Chalard Jean
Browse files

Always startOrMigrate connection when caps change

This is a simplification whose main point is to make
regular the recovery mechanisms. When a new NC is found,
there is now a central function that can always be called
no matter the state, which is valuable because it can be
copied in other cases where a change is necessary. The
prime example of this will be changes of LP.

Bug: 269715746
Test: VpnTest
Change-Id: I7981668ea091db5103b749eb80502e9ba348d4f3
parent aac5467d
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -3738,12 +3738,10 @@ public class Vpn {
                    + mUnderlyingNetworkCapabilities + " to " + nc);
            final NetworkCapabilities oldNc = mUnderlyingNetworkCapabilities;
            mUnderlyingNetworkCapabilities = nc;
            if (oldNc == null) {
                // A new default network is available.
            if (oldNc == null || !nc.getSubscriptionIds().equals(oldNc.getSubscriptionIds())) {
                // A new default network is available, or the subscription has changed.
                // Try to migrate the session, or failing that, start a new one.
                startOrMigrateIkeSession(mActiveNetwork);
            } else if (!nc.getSubscriptionIds().equals(oldNc.getSubscriptionIds())) {
                // Renew carrierConfig values.
                maybeMigrateIkeSessionAndUpdateVpnTransportInfo(mActiveNetwork);
            }
        }