Merge "Fix that fail to setup any vpn after Network Settings reset and always-on vpn is on" into nyc-dev am: 265f4113ee am: 6cbf4e5119
am: 01dbfb8b2e
* commit '01dbfb8b2e36ffe7b047395f5a66f8196a6fc0d3':
Fix that fail to setup any vpn after Network Settings reset and always-on vpn is on
Change-Id: I4641b2813820c82cc8509e0ba27f679733d45d6b
This commit is contained in:
@@ -5208,6 +5208,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) {
|
||||
@@ -5218,7 +5227,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user