am 0a59b500
: Integrate VPN with new keystore and misc fixes.
Merge commit '0a59b500147cc038541f6f2897de7e28c15a12c1' * commit '0a59b500147cc038541f6f2897de7e28c15a12c1': Integrate VPN with new keystore and misc fixes.
This commit is contained in:
committed by
The Android Open Source Project
commit
7888cc450a
@@ -589,8 +589,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);
|
||||
@@ -703,11 +702,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();
|
||||
}
|
||||
@@ -717,6 +720,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);
|
||||
@@ -785,6 +793,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)
|
||||
@@ -802,6 +816,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)
|
||||
@@ -847,9 +868,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