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
This commit is contained in:
committed by
Android (Google) Code Review
commit
b5f2dfbc22
@@ -24,6 +24,7 @@ import com.google.android.collect.Maps;
|
|||||||
import android.accounts.Account;
|
import android.accounts.Account;
|
||||||
import android.accounts.AccountManager;
|
import android.accounts.AccountManager;
|
||||||
import android.accounts.OnAccountsUpdateListener;
|
import android.accounts.OnAccountsUpdateListener;
|
||||||
|
import android.app.ActivityManager;
|
||||||
import android.app.AlarmManager;
|
import android.app.AlarmManager;
|
||||||
import android.app.Notification;
|
import android.app.Notification;
|
||||||
import android.app.NotificationManager;
|
import android.app.NotificationManager;
|
||||||
@@ -86,8 +87,13 @@ public class SyncManager implements OnAccountsUpdateListener {
|
|||||||
private static final long MAX_TIME_PER_SYNC;
|
private static final long MAX_TIME_PER_SYNC;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
MAX_SIMULTANEOUS_INITIALIZATION_SYNCS = SystemProperties.getInt("sync.max_init_syncs", 5);
|
final boolean isLargeRAM = ActivityManager.isLargeRAM();
|
||||||
MAX_SIMULTANEOUS_REGULAR_SYNCS = SystemProperties.getInt("sync.max_regular_syncs", 2);
|
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 =
|
LOCAL_SYNC_DELAY =
|
||||||
SystemProperties.getLong("sync.local_sync_delay", 30 * 1000 /* 30 seconds */);
|
SystemProperties.getLong("sync.local_sync_delay", 30 * 1000 /* 30 seconds */);
|
||||||
MAX_TIME_PER_SYNC =
|
MAX_TIME_PER_SYNC =
|
||||||
|
|||||||
Reference in New Issue
Block a user