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

Commit 6cbf4e51 authored by Victor Chang's avatar Victor Chang Committed by android-build-merger
Browse files

Merge "Fix that fail to setup any vpn after Network Settings reset and...

Merge "Fix that fail to setup any vpn after Network Settings reset and always-on vpn is on" into nyc-dev
am: 265f4113

* commit '265f4113':
  Fix that fail to setup any vpn after Network Settings reset and always-on vpn is on

Change-Id: Iba3df72496f067c5e0291449be3bfbd9ce2031ff
parents ced0e296 265f4113
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -5202,6 +5202,15 @@ public class ConnectivityService extends IConnectivityManager.Stub
        }

        if (!mUserManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_VPN)) {
            // Remove always-on package
            synchronized (mVpns) {
                final String alwaysOnPackage = getAlwaysOnVpnPackage(userId);
                if (alwaysOnPackage != null) {
                    setAlwaysOnVpnPackage(userId, null, false);
                    setVpnPackageAuthorization(alwaysOnPackage, userId, false);
                }
            }

            // Turn VPN off
            VpnConfig vpnConfig = getVpnConfig(userId);
            if (vpnConfig != null) {
@@ -5212,7 +5221,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
                    // in the future without user intervention.
                    setVpnPackageAuthorization(vpnConfig.user, userId, false);

                    prepareVpn(vpnConfig.user, VpnConfig.LEGACY_VPN, userId);
                    prepareVpn(null, VpnConfig.LEGACY_VPN, userId);
                }
            }
        }