diff options
author | Chia-chi Yeh <chiachi@android.com> | 2011-07-02 17:26:26 -0700 |
---|---|---|
committer | Chia-chi Yeh <chiachi@android.com> | 2011-07-02 17:26:26 -0700 |
commit | d95ec871138ebb367cfd8b67b4814438ac30c628 (patch) | |
tree | a96c35210b4665adde29c96a88e67a9177415765 /src | |
parent | 0082d17ce7ad2f8b3601068e62eda92aa8670a0f (diff) | |
download | packages_apps_settings-d95ec871138ebb367cfd8b67b4814438ac30c628.zip packages_apps_settings-d95ec871138ebb367cfd8b67b4814438ac30c628.tar.gz packages_apps_settings-d95ec871138ebb367cfd8b67b4814438ac30c628.tar.bz2 |
VpnSettings: hook up the legacy VPN with IConnectivityManager.
The status report is not implemented yet.
Change-Id: I266f840371e3698f779124d5e67bafe4d272cd94
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/vpn2/VpnSettings.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/com/android/settings/vpn2/VpnSettings.java b/src/com/android/settings/vpn2/VpnSettings.java index 56fb983..d3e8ac0 100644 --- a/src/com/android/settings/vpn2/VpnSettings.java +++ b/src/com/android/settings/vpn2/VpnSettings.java @@ -37,8 +37,10 @@ import android.view.MenuItem; import android.view.View; import android.widget.AdapterView.AdapterContextMenuInfo; +import com.android.internal.net.VpnConfig; import com.android.settings.SettingsPreferenceFragment; +import java.util.Arrays; import java.util.HashMap; public class VpnSettings extends SettingsPreferenceFragment implements @@ -328,7 +330,7 @@ public class VpnSettings extends SettingsPreferenceFragment implements "name", profile.username, "password", profile.password, "linkname", "vpn", "refuse-eap", "nodefaultroute", "usepeerdns", "idle", "1800", "mtu", "1400", "mru", "1400", - (profile.mppe ? "+mppe" : "nomppe"), + "ipparam", profile.routes, (profile.mppe ? "+mppe" : "nomppe"), }; break; case VpnProfile.TYPE_L2TP_IPSEC_PSK: @@ -338,12 +340,20 @@ public class VpnSettings extends SettingsPreferenceFragment implements "name", profile.username, "password", profile.password, "linkname", "vpn", "refuse-eap", "nodefaultroute", "usepeerdns", "idle", "1800", "mtu", "1400", "mru", "1400", + "ipparam", profile.routes, }; break; } + VpnConfig config = new VpnConfig(); + config.sessionName = profile.name; + config.routes = profile.routes; + if (!profile.searchDomains.isEmpty()) { + config.searchDomains = Arrays.asList(profile.searchDomains.split(" ")); + } + try { -// getService().doLegacyVpn(racoon, mtpd); + getService().doLegacyVpn(config, racoon, mtpd); } catch (Exception e) { Log.e(TAG, "connect", e); } |