am b5f2dfbc: Merge "By default ICS allows two syncs to run in parallel. Make it only do one at a time for devices that don\'t have much RAM as defined by the call ActivityManager.isLargeRAM()" into ics-mr1

* commit 'b5f2dfbc221d3dc799232e0ada3b6621d3d4d597':
  By default ICS allows two syncs to run in parallel. Make it only do one at a time for devices that don't have much RAM as defined by the call ActivityManager.isLargeRAM()
This commit is contained in:
Fred Quintana
2011-12-05 16:47:06 -08:00
committed by Android Git Automerger

View File

@@ -24,6 +24,7 @@ import com.google.android.collect.Maps;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.accounts.OnAccountsUpdateListener;
import android.app.ActivityManager;
import android.app.AlarmManager;
import android.app.Notification;
import android.app.NotificationManager;
@@ -86,8 +87,13 @@ public class SyncManager implements OnAccountsUpdateListener {
private static final long MAX_TIME_PER_SYNC;
static {
MAX_SIMULTANEOUS_INITIALIZATION_SYNCS = SystemProperties.getInt("sync.max_init_syncs", 5);
MAX_SIMULTANEOUS_REGULAR_SYNCS = SystemProperties.getInt("sync.max_regular_syncs", 2);
final boolean isLargeRAM = ActivityManager.isLargeRAM();
int defaultMaxInitSyncs = isLargeRAM ? 5 : 2;
int defaultMaxRegularSyncs = isLargeRAM ? 2 : 1;
MAX_SIMULTANEOUS_INITIALIZATION_SYNCS =
SystemProperties.getInt("sync.max_init_syncs", defaultMaxInitSyncs);
MAX_SIMULTANEOUS_REGULAR_SYNCS =
SystemProperties.getInt("sync.max_regular_syncs", defaultMaxRegularSyncs);
LOCAL_SYNC_DELAY =
SystemProperties.getLong("sync.local_sync_delay", 30 * 1000 /* 30 seconds */);
MAX_TIME_PER_SYNC =