diff options
Diffstat (limited to 'src/com/android/settings/vpn2')
-rw-r--r-- | src/com/android/settings/vpn2/VpnDialog.java | 11 | ||||
-rw-r--r-- | src/com/android/settings/vpn2/VpnSettings.java | 14 |
2 files changed, 13 insertions, 12 deletions
diff --git a/src/com/android/settings/vpn2/VpnDialog.java b/src/com/android/settings/vpn2/VpnDialog.java index c1a4531..cce5e2d 100644 --- a/src/com/android/settings/vpn2/VpnDialog.java +++ b/src/com/android/settings/vpn2/VpnDialog.java @@ -213,7 +213,6 @@ class VpnDialog extends AlertDialog implements TextWatcher, // First, hide everything. mMppe.setVisibility(View.GONE); mView.findViewById(R.id.l2tp).setVisibility(View.GONE); - mView.findViewById(R.id.ipsec_id).setVisibility(View.GONE); mView.findViewById(R.id.ipsec_psk).setVisibility(View.GONE); mView.findViewById(R.id.ipsec_user).setVisibility(View.GONE); mView.findViewById(R.id.ipsec_ca).setVisibility(View.GONE); @@ -223,12 +222,11 @@ class VpnDialog extends AlertDialog implements TextWatcher, case VpnProfile.TYPE_PPTP: mMppe.setVisibility(View.VISIBLE); break; + case VpnProfile.TYPE_L2TP_IPSEC_PSK: mView.findViewById(R.id.l2tp).setVisibility(View.VISIBLE); - mView.findViewById(R.id.ipsec_psk).setVisibility(View.VISIBLE); - break; + // fall through case VpnProfile.TYPE_IPSEC_XAUTH_PSK: - mView.findViewById(R.id.ipsec_id).setVisibility(View.VISIBLE); mView.findViewById(R.id.ipsec_psk).setVisibility(View.VISIBLE); break; @@ -255,6 +253,7 @@ class VpnDialog extends AlertDialog implements TextWatcher, } switch (mType.getSelectedItemPosition()) { case VpnProfile.TYPE_PPTP: + case VpnProfile.TYPE_IPSEC_HYBRID_RSA: return true; case VpnProfile.TYPE_L2TP_IPSEC_PSK: @@ -343,10 +342,10 @@ class VpnDialog extends AlertDialog implements TextWatcher, case VpnProfile.TYPE_PPTP: profile.mppe = mMppe.isChecked(); break; + case VpnProfile.TYPE_L2TP_IPSEC_PSK: profile.l2tpSecret = mL2tpSecret.getText().toString(); - profile.ipsecSecret = mIpsecSecret.getText().toString(); - break; + // fall through case VpnProfile.TYPE_IPSEC_XAUTH_PSK: profile.ipsecIdentifier = mIpsecIdentifier.getText().toString(); profile.ipsecSecret = mIpsecSecret.getText().toString(); diff --git a/src/com/android/settings/vpn2/VpnSettings.java b/src/com/android/settings/vpn2/VpnSettings.java index 5fe6426..0197333 100644 --- a/src/com/android/settings/vpn2/VpnSettings.java +++ b/src/com/android/settings/vpn2/VpnSettings.java @@ -53,7 +53,6 @@ public class VpnSettings extends SettingsPreferenceFragment implements DialogInterface.OnClickListener, DialogInterface.OnDismissListener { private static final String TAG = "VpnSettings"; - private static final String SCRIPT = "/etc/ppp/ip-up-vpn"; private final IConnectivityManager mService = IConnectivityManager.Stub .asInterface(ServiceManager.getService(Context.CONNECTIVITY_SERVICE)); @@ -171,7 +170,9 @@ public class VpnSettings extends SettingsPreferenceFragment implements } // Unregister for context menu. - unregisterForContextMenu(getListView()); + if (getView() != null) { + unregisterForContextMenu(getListView()); + } } @Override @@ -373,7 +374,8 @@ public class VpnSettings extends SettingsPreferenceFragment implements switch (profile.type) { case VpnProfile.TYPE_L2TP_IPSEC_PSK: racoon = new String[] { - interfaze, profile.server, "udppsk", profile.ipsecSecret, "1701", + interfaze, profile.server, "udppsk", profile.ipsecIdentifier, + profile.ipsecSecret, "1701", }; break; case VpnProfile.TYPE_L2TP_IPSEC_RSA: @@ -384,19 +386,19 @@ public class VpnSettings extends SettingsPreferenceFragment implements case VpnProfile.TYPE_IPSEC_XAUTH_PSK: racoon = new String[] { interfaze, profile.server, "xauthpsk", profile.ipsecIdentifier, - profile.ipsecSecret, profile.username, profile.password, SCRIPT, gateway, + profile.ipsecSecret, profile.username, profile.password, "", gateway, }; break; case VpnProfile.TYPE_IPSEC_XAUTH_RSA: racoon = new String[] { interfaze, profile.server, "xauthrsa", privateKey, userCert, caCert, - profile.username, profile.password, SCRIPT, gateway, + profile.username, profile.password, "", gateway, }; break; case VpnProfile.TYPE_IPSEC_HYBRID_RSA: racoon = new String[] { interfaze, profile.server, "hybridrsa", caCert, - profile.username, profile.password, SCRIPT, gateway, + profile.username, profile.password, "", gateway, }; break; } |