summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHung-ying Tyan <tyanh@google.com>2009-09-12 01:31:11 +0800
committerHung-ying Tyan <tyanh@google.com>2009-09-14 11:54:29 +0800
commita3aaf19e09806f7e56c59621fc6c17e4429b2e6d (patch)
treeabd60427b5e4f5ed64a09dd090eb5c229199ef00
parent5f23cb39a1bd9c319383108c209fca7f0256894b (diff)
downloadpackages_apps_settings-a3aaf19e09806f7e56c59621fc6c17e4429b2e6d.zip
packages_apps_settings-a3aaf19e09806f7e56c59621fc6c17e4429b2e6d.tar.gz
packages_apps_settings-a3aaf19e09806f7e56c59621fc6c17e4429b2e6d.tar.bz2
Fix setting passwd string and vpn checkbox titles.
* Add min length requirement in setting passwd string. * Do not change vpn checkbox title with state changes.
-rw-r--r--res/values/strings.xml2
-rw-r--r--src/com/android/settings/vpn/L2tpEditor.java4
-rw-r--r--src/com/android/settings/vpn/PptpEditor.java4
-rw-r--r--src/com/android/settings/vpn/VpnProfileEditor.java7
4 files changed, 5 insertions, 12 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 4db2104..c9ad806 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -2057,7 +2057,7 @@ found in the list of installed applications.</string>
<!-- Description for the confirm-new-password input box -->
<string name="cstor_confirm_password">Confirm new password:</string>
<!-- Description when user set up the storage for the very first time -->
- <string name="cstor_first_time_hint">Set a password for the credential storage.</string>
+ <string name="cstor_first_time_hint">Set a password for the credential storage (at least 8 characters).</string>
<!-- Description when user set up the storage for the very first time from an action that requires the credential storage-->
<string name="cstor_first_time_hint_from_action">Set a password for the credential storage.</string>
<string name="cstor_password_error">Please enter the correct password.</string>
diff --git a/src/com/android/settings/vpn/L2tpEditor.java b/src/com/android/settings/vpn/L2tpEditor.java
index 29036f2..05d51d6 100644
--- a/src/com/android/settings/vpn/L2tpEditor.java
+++ b/src/com/android/settings/vpn/L2tpEditor.java
@@ -57,7 +57,7 @@ class L2tpEditor extends VpnProfileEditor {
final L2tpProfile profile = (L2tpProfile) getProfile();
CheckBoxPreference secret = mSecret = new CheckBoxPreference(c);
boolean enabled = profile.isSecretEnabled();
- setSecretTitle(secret, R.string.vpn_l2tp_secret, enabled);
+ setCheckBoxTitle(secret, R.string.vpn_l2tp_secret);
secret.setChecked(enabled);
setSecretSummary(secret, enabled);
secret.setOnPreferenceChangeListener(
@@ -67,8 +67,6 @@ class L2tpEditor extends VpnProfileEditor {
boolean enabled = (Boolean) newValue;
profile.setSecretEnabled(enabled);
mSecretHandler.getPreference().setEnabled(enabled);
- setSecretTitle(mSecret, R.string.vpn_l2tp_secret,
- enabled);
setSecretSummary(mSecret, enabled);
return true;
}
diff --git a/src/com/android/settings/vpn/PptpEditor.java b/src/com/android/settings/vpn/PptpEditor.java
index fafe6a7..cfb3fa3 100644
--- a/src/com/android/settings/vpn/PptpEditor.java
+++ b/src/com/android/settings/vpn/PptpEditor.java
@@ -45,7 +45,7 @@ class PptpEditor extends VpnProfileEditor {
final PptpProfile profile = (PptpProfile) getProfile();
CheckBoxPreference encryption = mEncryption = new CheckBoxPreference(c);
boolean enabled = profile.isEncryptionEnabled();
- setSecretTitle(encryption, R.string.vpn_pptp_encryption_title, enabled);
+ setCheckBoxTitle(encryption, R.string.vpn_pptp_encryption_title);
encryption.setChecked(enabled);
setEncryptionSummary(encryption, enabled);
encryption.setOnPreferenceChangeListener(
@@ -54,8 +54,6 @@ class PptpEditor extends VpnProfileEditor {
Preference pref, Object newValue) {
boolean enabled = (Boolean) newValue;
profile.setEncryptionEnabled(enabled);
- setSecretTitle(mEncryption,
- R.string.vpn_pptp_encryption_title, enabled);
setEncryptionSummary(mEncryption, enabled);
return true;
}
diff --git a/src/com/android/settings/vpn/VpnProfileEditor.java b/src/com/android/settings/vpn/VpnProfileEditor.java
index 8dc3643..100b78e 100644
--- a/src/com/android/settings/vpn/VpnProfileEditor.java
+++ b/src/com/android/settings/vpn/VpnProfileEditor.java
@@ -174,12 +174,9 @@ class VpnProfileEditor {
: v);
}
- protected void setSecretTitle(
- CheckBoxPreference pref, int fieldNameId, boolean enabled) {
+ protected void setCheckBoxTitle(CheckBoxPreference pref, int fieldNameId) {
Context c = pref.getContext();
- String formatString = enabled
- ? c.getString(R.string.vpn_disable_field)
- : c.getString(R.string.vpn_enable_field);
+ String formatString = c.getString(R.string.vpn_enable_field);
pref.setTitle(String.format(formatString, c.getString(fieldNameId)));
}