am 38322393: Merge change 9437 into donut
Merge commit '38322393a6d029349ef4ef4f80757da175029bcb'
* commit '38322393a6d029349ef4ef4f80757da175029bcb':
Reduce the number of keystore connections.
diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java
index 9e5629d..6f2439c 100644
--- a/src/com/android/settings/SecuritySettings.java
+++ b/src/com/android/settings/SecuritySettings.java
@@ -236,9 +236,10 @@
PreferenceCategory credStoreCat = new PreferenceCategory(this);
credStoreCat.setTitle(R.string.cstor_settings_category);
root.addPreference(credStoreCat);
- credStoreCat.addPreference(mCstorHelper.createAccessCheckBox());
+ boolean i = mCstorHelper.isCstorInitialized();
+ credStoreCat.addPreference(mCstorHelper.createAccessCheckBox(i));
credStoreCat.addPreference(mCstorHelper.createSetPasswordPreference());
- credStoreCat.addPreference(mCstorHelper.createResetPreference());
+ credStoreCat.addPreference(mCstorHelper.createResetPreference(i));
return root;
}
@@ -805,12 +806,12 @@
mResetButton.setEnabled(enabled);
}
- private Preference createAccessCheckBox() {
+ private Preference createAccessCheckBox(boolean isInitialized) {
CheckBoxPreference pref = new CheckBoxPreference(
SecuritySettings.this);
pref.setTitle(R.string.cstor_access_title);
pref.setSummary(R.string.cstor_access_summary);
- pref.setChecked(isCstorUnlocked());
+ if (isInitialized) pref.setChecked(isCstorUnlocked());
pref.setOnPreferenceChangeListener(
new Preference.OnPreferenceChangeListener() {
public boolean onPreferenceChange(
@@ -825,7 +826,7 @@
return true;
}
});
- pref.setEnabled(isCstorInitialized());
+ pref.setEnabled(isInitialized);
mAccessCheckBox = pref;
return pref;
}
@@ -846,7 +847,7 @@
return pref;
}
- private Preference createResetPreference() {
+ private Preference createResetPreference(boolean isInitialized) {
Preference pref = new Preference(SecuritySettings.this);
pref.setTitle(R.string.cstor_reset_title);
pref.setSummary(R.string.cstor_reset_summary);
@@ -857,7 +858,7 @@
return true;
}
});
- pref.setEnabled(isCstorInitialized());
+ pref.setEnabled(isInitialized);
mResetButton = pref;
return pref;
}