• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

packages/apps/Settings


Commit MetaInfo

Révision79f9fa073cf3311b552a0a055a44a26c06e395d3 (tree)
l'heure2009-08-01 11:08:03
AuteurHung-ying Tyan <tyanh@goog...>
CommiterHung-ying Tyan

Message de Log

Reduce the number of keystore connections.

Change Summary

Modification

--- a/src/com/android/settings/SecuritySettings.java
+++ b/src/com/android/settings/SecuritySettings.java
@@ -233,9 +233,10 @@ public class SecuritySettings extends PreferenceActivity implements
233233 PreferenceCategory credStoreCat = new PreferenceCategory(this);
234234 credStoreCat.setTitle(R.string.cstor_settings_category);
235235 root.addPreference(credStoreCat);
236- credStoreCat.addPreference(mCstorHelper.createAccessCheckBox());
236+ boolean i = mCstorHelper.isCstorInitialized();
237+ credStoreCat.addPreference(mCstorHelper.createAccessCheckBox(i));
237238 credStoreCat.addPreference(mCstorHelper.createSetPasswordPreference());
238- credStoreCat.addPreference(mCstorHelper.createResetPreference());
239+ credStoreCat.addPreference(mCstorHelper.createResetPreference(i));
239240
240241 return root;
241242 }
@@ -793,12 +794,12 @@ public class SecuritySettings extends PreferenceActivity implements
793794 mResetButton.setEnabled(enabled);
794795 }
795796
796- private Preference createAccessCheckBox() {
797+ private Preference createAccessCheckBox(boolean isInitialized) {
797798 CheckBoxPreference pref = new CheckBoxPreference(
798799 SecuritySettings.this);
799800 pref.setTitle(R.string.cstor_access_title);
800801 pref.setSummary(R.string.cstor_access_summary);
801- pref.setChecked(isCstorUnlocked());
802+ if (isInitialized) pref.setChecked(isCstorUnlocked());
802803 pref.setOnPreferenceChangeListener(
803804 new Preference.OnPreferenceChangeListener() {
804805 public boolean onPreferenceChange(
@@ -813,7 +814,7 @@ public class SecuritySettings extends PreferenceActivity implements
813814 return true;
814815 }
815816 });
816- pref.setEnabled(isCstorInitialized());
817+ pref.setEnabled(isInitialized);
817818 mAccessCheckBox = pref;
818819 return pref;
819820 }
@@ -834,7 +835,7 @@ public class SecuritySettings extends PreferenceActivity implements
834835 return pref;
835836 }
836837
837- private Preference createResetPreference() {
838+ private Preference createResetPreference(boolean isInitialized) {
838839 Preference pref = new Preference(SecuritySettings.this);
839840 pref.setTitle(R.string.cstor_reset_title);
840841 pref.setSummary(R.string.cstor_reset_summary);
@@ -845,7 +846,7 @@ public class SecuritySettings extends PreferenceActivity implements
845846 return true;
846847 }
847848 });
848- pref.setEnabled(isCstorInitialized());
849+ pref.setEnabled(isInitialized);
849850 mResetButton = pref;
850851 return pref;
851852 }