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
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user