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