Add lockdownEnabled parameter to always-on VPN API

Allows callers to opt-out of blockading network traffic during boot and
on VPN app failure.

Bug: 26694104
Change-Id: Ic2c25b79d8a17917025eb37be7de929fe156e2a3
This commit is contained in:
Robin Lee
2016-05-03 13:27:05 +01:00
parent e69d754865
commit cdebe28c15
3 changed files with 5 additions and 3 deletions

View File

@@ -176,7 +176,8 @@ public class AppManagementFragment extends SettingsPreferenceFragment
if (mUserId == UserHandle.USER_SYSTEM) {
VpnUtils.clearLockdownVpn(getContext());
}
mConnectivityManager.setAlwaysOnVpnPackageForUser(mUserId, isEnabled ? mPackageName : null);
mConnectivityManager.setAlwaysOnVpnPackageForUser(mUserId, isEnabled ? mPackageName : null,
/* lockdownEnabled */ false);
if (isEnabled && !isVpnAlwaysOn()) {
CannotConnectFragment.show(this, mVpnLabel);
}