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
This commit is contained in:
@@ -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());
|
||||
|
||||
|
Reference in New Issue
Block a user