Merge "More SharedPreferences commit() -> apply() changes." into gingerbread
This commit is contained in:
committed by
Android (Google) Code Review
commit
a2f2141c84
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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) ||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user