Merge "More SharedPreferences commit() -> apply() changes." into gingerbread

This commit is contained in:
Brad Fitzpatrick
2010-09-03 12:46:25 -07:00
committed by Android (Google) Code Review
5 changed files with 7 additions and 7 deletions

View File

@@ -443,7 +443,7 @@ public class PreferenceManager {
pm.setSharedPreferencesMode(sharedPreferencesMode);
pm.inflateFromResource(context, resId, null);
defaultValueSp.edit().putBoolean(KEY_HAS_SET_DEFAULT_VALUES, true).commit();
defaultValueSp.edit().putBoolean(KEY_HAS_SET_DEFAULT_VALUES, true).apply();
}
}
@@ -481,7 +481,7 @@ public class PreferenceManager {
private void setNoCommit(boolean noCommit) {
if (!noCommit && mEditor != null) {
mEditor.commit();
mEditor.apply();
}
mNoCommit = noCommit;

View File

@@ -286,7 +286,7 @@ public abstract class PhoneBase extends Handler implements Phone {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getContext());
SharedPreferences.Editor editor = sp.edit();
editor.putBoolean(DNS_SERVER_CHECK_DISABLED_KEY, b);
editor.commit();
editor.apply();
}
/**

View File

@@ -1405,7 +1405,7 @@ public class CDMAPhone extends PhoneBase {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getContext());
SharedPreferences.Editor editor = sp.edit();
editor.putString(VM_NUMBER_CDMA, number);
editor.commit();
editor.apply();
}
/**

View File

@@ -127,7 +127,7 @@ final class CdmaSMSDispatcher extends SMSDispatcher {
mPhone.getContext());
SharedPreferences.Editor editor = sp.edit();
editor.putInt(CDMAPhone.VM_COUNT_CDMA, voicemailCount);
editor.commit();
editor.apply();
((CDMAPhone) mPhone).updateMessageWaitingIndicator(voicemailCount);
handled = true;
} else if (((SmsEnvelope.TELESERVICE_WMT == teleService) ||

View File

@@ -807,7 +807,7 @@ public class GSMPhone extends PhoneBase {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getContext());
SharedPreferences.Editor editor = sp.edit();
editor.putString(VM_NUMBER, number);
editor.commit();
editor.apply();
setVmSimImsi(getSubscriberId());
}
@@ -830,7 +830,7 @@ public class GSMPhone extends PhoneBase {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getContext());
SharedPreferences.Editor editor = sp.edit();
editor.putString(VM_SIM_IMSI, imsi);
editor.commit();
editor.apply();
}
public String getVoiceMailAlphaTag() {