SecuritySettings: minor tuning.
This commit is contained in:
@@ -419,12 +419,14 @@ public class SecuritySettings extends PreferenceActivity {
|
|||||||
|
|
||||||
public boolean onPreferenceChange(Preference preference, Object value) {
|
public boolean onPreferenceChange(Preference preference, Object value) {
|
||||||
if (preference == mAccessCheckBox) {
|
if (preference == mAccessCheckBox) {
|
||||||
if ((Boolean) value) {
|
boolean checked = (Boolean) value;
|
||||||
|
if (checked) {
|
||||||
showDialog((mState == KeyStore.UNINITIALIZED) ?
|
showDialog((mState == KeyStore.UNINITIALIZED) ?
|
||||||
PASSWORD_DIALOG : UNLOCK_DIALOG);
|
PASSWORD_DIALOG : UNLOCK_DIALOG);
|
||||||
} else {
|
} else {
|
||||||
lock();
|
lock();
|
||||||
}
|
}
|
||||||
|
mAccessCheckBox.setChecked(!checked);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -459,7 +461,6 @@ public class SecuritySettings extends PreferenceActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
removeDialog(mDialogId);
|
removeDialog(mDialogId);
|
||||||
updatePreferences(mState);
|
|
||||||
if (mExternalIntent != null) {
|
if (mExternalIntent != null) {
|
||||||
mExternalIntent = null;
|
mExternalIntent = null;
|
||||||
finish();
|
finish();
|
||||||
@@ -566,8 +567,9 @@ public class SecuritySettings extends PreferenceActivity {
|
|||||||
mResetButton.setEnabled(state != KeyStore.UNINITIALIZED);
|
mResetButton.setEnabled(state != KeyStore.UNINITIALIZED);
|
||||||
|
|
||||||
// Show a toast message if the state is changed.
|
// Show a toast message if the state is changed.
|
||||||
if (mState == state) return;
|
if (mState == state) {
|
||||||
if (state == KeyStore.NO_ERROR) {
|
return;
|
||||||
|
} else if (state == KeyStore.NO_ERROR) {
|
||||||
Toast.makeText(SecuritySettings.this, R.string.credentials_enabled,
|
Toast.makeText(SecuritySettings.this, R.string.credentials_enabled,
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
} else if (state == KeyStore.UNINITIALIZED) {
|
} else if (state == KeyStore.UNINITIALIZED) {
|
||||||
|
Reference in New Issue
Block a user