summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/SecuritySettings.java
diff options
context:
space:
mode:
authorHung-ying Tyan <tyanh@google.com>2009-07-06 17:26:34 +0800
committerHung-ying Tyan <tyanh@google.com>2009-07-06 18:47:47 +0800
commit0a59b500147cc038541f6f2897de7e28c15a12c1 (patch)
treef5d44650a99de7e5bc86933e8764d3d51c970da3 /src/com/android/settings/SecuritySettings.java
parenteb7836f11ec4e9753db7c6ecd9414e153bb7bdbe (diff)
downloadpackages_apps_Settings-0a59b500147cc038541f6f2897de7e28c15a12c1.tar.gz
packages_apps_Settings-0a59b500147cc038541f6f2897de7e28c15a12c1.tar.bz2
packages_apps_Settings-0a59b500147cc038541f6f2897de7e28c15a12c1.zip
Integrate VPN with new keystore and misc fixes.
* Changes + Pass intent to keystore when needed and hooks to resume from it. + Generate random, unique ID for profile instead of base64 from its name. + Add VPN to "Wirless controls" description. + Add credential storage to "Security & location" description. + More hints to set password and unlock dialogs in credential storage settings for actions that come from other processes. + Sort VPN profiles according to the names. + Replace Keystore with CertTool in L2tpIpsecEditor
Diffstat (limited to 'src/com/android/settings/SecuritySettings.java')
-rw-r--r--src/com/android/settings/SecuritySettings.java33
1 files changed, 27 insertions, 6 deletions
diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java
index 4e77d6b3c..73578c738 100644
--- a/src/com/android/settings/SecuritySettings.java
+++ b/src/com/android/settings/SecuritySettings.java
@@ -577,8 +577,7 @@ public class SecuritySettings extends PreferenceActivity implements
: R.string.cstor_password_error);
if (count <= 3) {
if (count == 1) {
- v.setText(getString(
- R.string.cstor_password_error_reset_warning));
+ v.setText(R.string.cstor_password_error_reset_warning);
} else {
String format = getString(
R.string.cstor_password_error_reset_warning_plural);
@@ -691,11 +690,15 @@ public class SecuritySettings extends PreferenceActivity implements
return v;
}
- private void hideError() {
- View v = mView.findViewById(R.id.cstor_error);
+ private void hide(int viewId) {
+ View v = mView.findViewById(viewId);
if (v != null) v.setVisibility(View.GONE);
}
+ private void hideError() {
+ hide(R.id.cstor_error);
+ }
+
private String getText(int viewId) {
return ((TextView) mView.findViewById(viewId)).getText().toString();
}
@@ -705,6 +708,11 @@ public class SecuritySettings extends PreferenceActivity implements
if (v != null) v.setText(text);
}
+ private void setText(int viewId, int textId) {
+ TextView v = (TextView) mView.findViewById(viewId);
+ if (v != null) v.setText(textId);
+ }
+
private void enablePreferences(boolean enabled) {
mAccessCheckBox.setEnabled(enabled);
mResetButton.setEnabled(enabled);
@@ -773,6 +781,12 @@ public class SecuritySettings extends PreferenceActivity implements
R.layout.cstor_unlock_dialog_view, null);
hideError();
+ // show extra hint only when the action comes from outside
+ if ((mSpecialIntent == null)
+ && (mCstorAddCredentialHelper == null)) {
+ hide(R.id.cstor_access_dialog_hint_from_action);
+ }
+
Dialog d = new AlertDialog.Builder(SecuritySettings.this)
.setView(mView)
.setTitle(R.string.cstor_access_dialog_title)
@@ -790,6 +804,13 @@ public class SecuritySettings extends PreferenceActivity implements
R.layout.cstor_set_password_dialog_view, null);
hideError();
+ // show extra hint only when the action comes from outside
+ if ((mSpecialIntent != null)
+ || (mCstorAddCredentialHelper != null)) {
+ setText(R.id.cstor_first_time_hint,
+ R.string.cstor_first_time_hint_from_action);
+ }
+
switch (id) {
case CSTOR_INIT_DIALOG:
mView.findViewById(R.id.cstor_old_password_block)
@@ -835,9 +856,9 @@ public class SecuritySettings extends PreferenceActivity implements
hideError();
setText(R.id.cstor_credential_name_title,
- getString(R.string.cstor_credential_name));
+ R.string.cstor_credential_name);
setText(R.id.cstor_credential_info_title,
- getString(R.string.cstor_credential_info));
+ R.string.cstor_credential_info);
setText(R.id.cstor_credential_info,
mCstorAddCredentialHelper.getDescription().toString());