diff options
author | Debajit Ghosh <debajit@google.com> | 2009-09-14 14:58:31 -0700 |
---|---|---|
committer | Debajit Ghosh <debajit@google.com> | 2009-09-14 16:22:12 -0700 |
commit | 44ee0f03f99b3eea8bf3d3e7f63ad0553623f426 (patch) | |
tree | cdbab3248a32e4a32ab0b7591d82f13968f85eeb /core/java/android/content/SyncManager.java | |
parent | 1fa724470c4fbe64741ef1fd2eefc4d5438da896 (diff) | |
download | frameworks_base-44ee0f03f99b3eea8bf3d3e7f63ad0553623f426.zip frameworks_base-44ee0f03f99b3eea8bf3d3e7f63ad0553623f426.tar.gz frameworks_base-44ee0f03f99b3eea8bf3d3e7f63ad0553623f426.tar.bz2 |
add system properties for experimenting with sync timeouts.
Diffstat (limited to 'core/java/android/content/SyncManager.java')
-rw-r--r-- | core/java/android/content/SyncManager.java | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/core/java/android/content/SyncManager.java b/core/java/android/content/SyncManager.java index 6d27bc7..1e590f0 100644 --- a/core/java/android/content/SyncManager.java +++ b/core/java/android/content/SyncManager.java @@ -87,13 +87,37 @@ class SyncManager implements OnAccountsUpdatedListener { private static final long MILLIS_IN_4WEEKS = MILLIS_IN_WEEK * 4; /** Delay a sync due to local changes this long. In milliseconds */ - private static final long LOCAL_SYNC_DELAY = 30 * 1000; // 30 seconds + private static final long LOCAL_SYNC_DELAY; /** * If a sync takes longer than this and the sync queue is not empty then we will * cancel it and add it back to the end of the sync queue. In milliseconds. */ - private static final long MAX_TIME_PER_SYNC = 5 * 60 * 1000; // 5 minutes + private static final long MAX_TIME_PER_SYNC; + + static { + String localSyncDelayString = SystemProperties.get("sync.local_sync_delay"); + long localSyncDelay = 30 * 1000; // 30 seconds + if (localSyncDelayString != null) { + try { + localSyncDelay = Long.parseLong(localSyncDelayString); + } catch (NumberFormatException nfe) { + // ignore, use default + } + } + LOCAL_SYNC_DELAY = localSyncDelay; + + String maxTimePerSyncString = SystemProperties.get("sync.max_time_per_sync"); + long maxTimePerSync = 5 * 60 * 1000; // 5 minutes + if (maxTimePerSyncString != null) { + try { + maxTimePerSync = Long.parseLong(maxTimePerSyncString); + } catch (NumberFormatException nfe) { + // ignore, use default + } + } + MAX_TIME_PER_SYNC = maxTimePerSync; + } private static final long SYNC_NOTIFICATION_DELAY = 30 * 1000; // 30 seconds |