summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/vpn2
diff options
context:
space:
mode:
authorChia-chi Yeh <chiachi@android.com>2011-07-15 14:59:18 -0700
committerChia-chi Yeh <chiachi@android.com>2011-07-15 14:59:18 -0700
commitaa5b531b0b540488f47ad0414dc77eecbb47cd3a (patch)
tree389e6409335c8314c8b921732972332f1c908399 /src/com/android/settings/vpn2
parenta4e101b24bd0952c26e5b5c312981fd44fe49795 (diff)
downloadpackages_apps_Settings-aa5b531b0b540488f47ad0414dc77eecbb47cd3a.zip
packages_apps_Settings-aa5b531b0b540488f47ad0414dc77eecbb47cd3a.tar.gz
packages_apps_Settings-aa5b531b0b540488f47ad0414dc77eecbb47cd3a.tar.bz2
VpnSettings: use the real passwords instead of dummy strings.
Change-Id: Ib14350364740efe5529fa9ee264c69f91c06a538
Diffstat (limited to 'src/com/android/settings/vpn2')
-rw-r--r--src/com/android/settings/vpn2/VpnDialog.java27
1 files changed, 8 insertions, 19 deletions
diff --git a/src/com/android/settings/vpn2/VpnDialog.java b/src/com/android/settings/vpn2/VpnDialog.java
index 4f9d0a2..d644700 100644
--- a/src/com/android/settings/vpn2/VpnDialog.java
+++ b/src/com/android/settings/vpn2/VpnDialog.java
@@ -36,17 +36,6 @@ import android.widget.Spinner;
import android.widget.TextView;
class VpnDialog extends AlertDialog implements TextWatcher, OnItemSelectedListener {
- private static final String DUMMY = "\r";
-
- private static String getDummy(String secret) {
- return secret.isEmpty() ? "" : DUMMY;
- }
-
- private static String getSecret(String oldSecret, TextView view) {
- String newSecret = view.getText().toString();
- return DUMMY.equals(newSecret) ? oldSecret : newSecret;
- }
-
private final KeyStore mKeyStore = KeyStore.getInstance();
private final DialogInterface.OnClickListener mListener;
private final VpnProfile mProfile;
@@ -107,13 +96,13 @@ class VpnDialog extends AlertDialog implements TextWatcher, OnItemSelectedListen
mType.setSelection(mProfile.type);
mServer.setText(mProfile.server);
mUsername.setText(mProfile.username);
- mPassword.setText(getDummy(mProfile.password));
+ mPassword.setText(mProfile.password);
mSearchDomains.setText(mProfile.searchDomains);
mRoutes.setText(mProfile.routes);
mMppe.setChecked(mProfile.mppe);
- mL2tpSecret.setText(getDummy(mProfile.l2tpSecret));
+ mL2tpSecret.setText(mProfile.l2tpSecret);
mIpsecIdentifier.setText(mProfile.ipsecIdentifier);
- mIpsecSecret.setText(getDummy(mProfile.ipsecSecret));
+ mIpsecSecret.setText(mProfile.ipsecSecret);
loadCertificates(mIpsecUserCert, Credentials.USER_CERTIFICATE,
0, mProfile.ipsecUserCert);
loadCertificates(mIpsecCaCert, Credentials.CA_CERTIFICATE,
@@ -288,7 +277,7 @@ class VpnDialog extends AlertDialog implements TextWatcher, OnItemSelectedListen
profile.type = mType.getSelectedItemPosition();
profile.server = mServer.getText().toString().trim();
profile.username = mUsername.getText().toString();
- profile.password = getSecret(mProfile.password, mPassword);
+ profile.password = mPassword.getText().toString();
profile.searchDomains = mSearchDomains.getText().toString().trim();
profile.routes = mRoutes.getText().toString().trim();
@@ -298,16 +287,16 @@ class VpnDialog extends AlertDialog implements TextWatcher, OnItemSelectedListen
profile.mppe = mMppe.isChecked();
break;
case VpnProfile.TYPE_L2TP_IPSEC_PSK:
- profile.l2tpSecret = getSecret(mProfile.l2tpSecret, mL2tpSecret);
- profile.ipsecSecret = getSecret(mProfile.ipsecSecret, mIpsecSecret);
+ profile.l2tpSecret = mL2tpSecret.getText().toString();
+ profile.ipsecSecret = mIpsecSecret.getText().toString();
break;
case VpnProfile.TYPE_IPSEC_XAUTH_PSK:
profile.ipsecIdentifier = mIpsecIdentifier.getText().toString();
- profile.ipsecSecret = getSecret(mProfile.ipsecSecret, mIpsecSecret);
+ profile.ipsecSecret = mIpsecSecret.getText().toString();
break;
case VpnProfile.TYPE_L2TP_IPSEC_RSA:
- profile.l2tpSecret = getSecret(mProfile.l2tpSecret, mL2tpSecret);
+ profile.l2tpSecret = mL2tpSecret.getText().toString();
// fall through
case VpnProfile.TYPE_IPSEC_XAUTH_RSA:
if (mIpsecUserCert.getSelectedItemPosition() != 0) {