Remove call to deprecated getBackgroundDataSetting()

It seems that the setting is now enforced at the network level (see
NetworkPolicyManagerService).

Bug: 15848128
Change-Id: Ie7d178bab8ebb133f78cb5356ee1c27fbe61ba05
This commit is contained in:
Alexandra Gherghina
2015-01-05 09:58:14 +00:00
parent c8c82f002d
commit 7e50b12fde

View File

@@ -34,7 +34,6 @@ import android.content.SyncAdapterType;
import android.content.SyncInfo;
import android.content.SyncStatusInfo;
import android.content.pm.ProviderInfo;
import android.net.ConnectivityManager;
import android.os.Bundle;
import android.os.UserHandle;
import android.os.UserManager;
@@ -440,12 +439,8 @@ public class AccountSyncSettings extends AccountPreferenceBase {
!initialSync);
syncPref.setFailed(lastSyncFailed);
ConnectivityManager connManager =
(ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
final boolean masterSyncAutomatically =
ContentResolver.getMasterSyncAutomaticallyAsUser(userId);
final boolean backgroundDataEnabled = connManager.getBackgroundDataSetting();
final boolean oneTimeSyncMode = !masterSyncAutomatically || !backgroundDataEnabled;
final boolean oneTimeSyncMode = !ContentResolver.getMasterSyncAutomaticallyAsUser(
userId);
syncPref.setOneTimeSyncMode(oneTimeSyncMode);
syncPref.setChecked(oneTimeSyncMode || syncEnabled);
}