From 88ee31e269a8d4ba46e5e32496d89447178e137d Mon Sep 17 00:00:00 2001 From: Jeremy Goldman Date: Mon, 12 Apr 2021 15:37:19 +0800 Subject: [PATCH] Maintain VPN type form the VpnProfile the connectedLegacyVpn may already exist within the VpnProfiles. Because the stub profile generated from the LegacyVpnInfo does not contain type information, overriding whether the VPN is insecure using this information will provide an incomplete picture. Test: atest -c SettingsUnitTests Bug: 184922172 Change-Id: Icf2e08826c444863eaebdaa47bfd217795d2bad6 --- src/com/android/settings/vpn2/VpnSettings.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/vpn2/VpnSettings.java b/src/com/android/settings/vpn2/VpnSettings.java index cdc65372aed..181b78f535c 100644 --- a/src/com/android/settings/vpn2/VpnSettings.java +++ b/src/com/android/settings/vpn2/VpnSettings.java @@ -304,7 +304,9 @@ public class VpnSettings extends RestrictedSettingsFragment implements LegacyVpnPreference p = mSettings.findOrCreatePreference(stubProfile, false); p.setState(vpn.state); p.setAlwaysOn(lockdownVpnKey != null && lockdownVpnKey.equals(vpn.key)); - p.setInsecureVpn(VpnProfile.isLegacyType(stubProfile.type)); + // (b/184921649) do not call setInsecureVpn() for connectedLegacyVpns, since the + // LegacyVpnInfo does not contain VPN type information, and the profile already + // exists within vpnProfiles. updates.add(p); }