summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2012-09-18 15:35:35 -0700
committerJeff Sharkey <jsharkey@android.com>2012-09-19 11:16:24 -0700
commitf5de1db28a61d159e62ef42f64a2cdcb316d0c2c (patch)
tree565fa2279e2c36e2048461c977b607f4478e29f6 /src
parentb92e9afe4d056ca69a43450dc5be6ffb7efa1ea1 (diff)
downloadpackages_apps_Settings-f5de1db28a61d159e62ef42f64a2cdcb316d0c2c.zip
packages_apps_Settings-f5de1db28a61d159e62ef42f64a2cdcb316d0c2c.tar.gz
packages_apps_Settings-f5de1db28a61d159e62ef42f64a2cdcb316d0c2c.tar.bz2
Omit PPTP VPNs from lockdown list.
Bug: 7064069 Change-Id: Ie4261828ef2dc5af32db3b327ca7ec00451e65d9
Diffstat (limited to 'src')
-rw-r--r--src/com/android/settings/vpn2/VpnSettings.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/com/android/settings/vpn2/VpnSettings.java b/src/com/android/settings/vpn2/VpnSettings.java
index 07aa04f..931f0c2 100644
--- a/src/com/android/settings/vpn2/VpnSettings.java
+++ b/src/com/android/settings/vpn2/VpnSettings.java
@@ -49,6 +49,7 @@ import android.widget.Toast;
import com.android.internal.net.LegacyVpnInfo;
import com.android.internal.net.VpnConfig;
import com.android.internal.net.VpnProfile;
+import com.android.internal.util.ArrayUtils;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
import com.google.android.collect.Lists;
@@ -463,7 +464,7 @@ public class VpnSettings extends SettingsPreferenceFragment implements
private void initProfiles(KeyStore keyStore, Resources res) {
final String lockdownKey = getStringOrNull(keyStore, Credentials.LOCKDOWN_VPN);
- mProfiles = loadVpnProfiles(keyStore);
+ mProfiles = loadVpnProfiles(keyStore, VpnProfile.TYPE_PPTP);
mTitles = Lists.newArrayList();
mTitles.add(res.getText(R.string.vpn_lockdown_none));
mCurrentIndex = 0;
@@ -523,14 +524,14 @@ public class VpnSettings extends SettingsPreferenceFragment implements
}
}
- private static List<VpnProfile> loadVpnProfiles(KeyStore keyStore) {
+ private static List<VpnProfile> loadVpnProfiles(KeyStore keyStore, int... excludeTypes) {
final ArrayList<VpnProfile> result = Lists.newArrayList();
final String[] keys = keyStore.saw(Credentials.VPN);
if (keys != null) {
for (String key : keys) {
final VpnProfile profile = VpnProfile.decode(
key, keyStore.get(Credentials.VPN + key));
- if (profile != null) {
+ if (profile != null && !ArrayUtils.contains(excludeTypes, profile.type)) {
result.add(profile);
}
}