summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Quintana <fredq@google.com>2010-03-01 13:00:26 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-03-01 13:00:26 -0800
commit881cc1dffb12a21cc9d2dbf1908b3a3cf4e1ac0c (patch)
treea0f8a2fe8519496f4081892207e0d47d39c1b387
parent74bfea76ea601017126714729f7cea68e5d9cbdb (diff)
parent82c5c4248a5dcd648ecbc311e2b8cd765c388aab (diff)
downloadframeworks_base-881cc1dffb12a21cc9d2dbf1908b3a3cf4e1ac0c.zip
frameworks_base-881cc1dffb12a21cc9d2dbf1908b3a3cf4e1ac0c.tar.gz
frameworks_base-881cc1dffb12a21cc9d2dbf1908b3a3cf4e1ac0c.tar.bz2
Merge "fix a bug where if a syncmanager gets back a SyncAlreadyInProgress error it immediately reschedules another sync, thus burning up the battery if the sync is in progress for a while."
-rw-r--r--core/java/android/content/SyncManager.java2
-rw-r--r--core/java/android/content/SyncOperation.java6
2 files changed, 4 insertions, 4 deletions
diff --git a/core/java/android/content/SyncManager.java b/core/java/android/content/SyncManager.java
index 393bbba..211a2ae 100644
--- a/core/java/android/content/SyncManager.java
+++ b/core/java/android/content/SyncManager.java
@@ -819,7 +819,7 @@ public class SyncManager implements OnAccountsUpdateListener {
}
scheduleSyncOperation(new SyncOperation(operation.account, operation.syncSource,
operation.authority, operation.extras,
- DELAY_RETRY_SYNC_IN_PROGRESS_IN_SECONDS));
+ DELAY_RETRY_SYNC_IN_PROGRESS_IN_SECONDS * 1000));
} else if (syncResult.hasSoftError()) {
if (isLoggable) {
Log.d(TAG, "retrying sync operation because it encountered a soft error: "
diff --git a/core/java/android/content/SyncOperation.java b/core/java/android/content/SyncOperation.java
index 4599165..3b3f9c1 100644
--- a/core/java/android/content/SyncOperation.java
+++ b/core/java/android/content/SyncOperation.java
@@ -19,7 +19,7 @@ public class SyncOperation implements Comparable {
public SyncStorageEngine.PendingOperation pendingOperation;
public SyncOperation(Account account, int source, String authority, Bundle extras,
- long delay) {
+ long delayInMs) {
this.account = account;
this.syncSource = source;
this.authority = authority;
@@ -33,12 +33,12 @@ public class SyncOperation implements Comparable {
removeFalseExtra(ContentResolver.SYNC_EXTRAS_EXPEDITED);
removeFalseExtra(ContentResolver.SYNC_EXTRAS_OVERRIDE_TOO_MANY_DELETIONS);
final long now = SystemClock.elapsedRealtime();
- if (delay < 0) {
+ if (delayInMs < 0) {
this.expedited = true;
this.earliestRunTime = now;
} else {
this.expedited = false;
- this.earliestRunTime = now + delay;
+ this.earliestRunTime = now + delayInMs;
}
this.key = toKey();
}