Fixing the write of BackgroundData setting, DO NOT MERGE.

I outsmarted myself trying to minimize writes and caused no writes to occur.

bug:3485934
Change-Id: I43b6ebbed3f13277edfb2e28f09cf7b98ea66776
This commit is contained in:
Wink Saville
2011-02-28 15:32:41 -08:00
parent abcb4fecfc
commit 28b7b21694

View File

@@ -989,14 +989,12 @@ public class ConnectivityService extends IConnectivityManager.Stub {
} }
private void handleSetBackgroundData(boolean enabled) { private void handleSetBackgroundData(boolean enabled) {
if (enabled != getBackgroundDataSetting()) {
Settings.Secure.putInt(mContext.getContentResolver(), Settings.Secure.putInt(mContext.getContentResolver(),
Settings.Secure.BACKGROUND_DATA, enabled ? 1 : 0); Settings.Secure.BACKGROUND_DATA, enabled ? 1 : 0);
Intent broadcast = new Intent( Intent broadcast = new Intent(
ConnectivityManager.ACTION_BACKGROUND_DATA_SETTING_CHANGED); ConnectivityManager.ACTION_BACKGROUND_DATA_SETTING_CHANGED);
mContext.sendBroadcast(broadcast); mContext.sendBroadcast(broadcast);
} }
}
/** /**
* @see ConnectivityManager#getMobileDataEnabled() * @see ConnectivityManager#getMobileDataEnabled()