diff options
author | Fred Quintana <fredq@google.com> | 2010-01-21 14:24:20 -0800 |
---|---|---|
committer | Fred Quintana <fredq@google.com> | 2010-01-25 16:41:58 -0800 |
commit | 307da1a46b4c9b711bafe8fbaaa6b98e8868c18e (patch) | |
tree | a83cd290b7fc4e6d7f11a56c96318f282df37838 /core/java/android/content/SyncResult.java | |
parent | e0560e484b4b31edbb81beae1dca7e109126cb73 (diff) | |
download | frameworks_base-307da1a46b4c9b711bafe8fbaaa6b98e8868c18e.zip frameworks_base-307da1a46b4c9b711bafe8fbaaa6b98e8868c18e.tar.gz frameworks_base-307da1a46b4c9b711bafe8fbaaa6b98e8868c18e.tar.bz2 |
enhance the sync manager backoff logic and add support for retry-after
moved SyncQueue and SyncOperation into their own top-level classes
to ease maintainability and testing6
removed some dead code
Diffstat (limited to 'core/java/android/content/SyncResult.java')
-rw-r--r-- | core/java/android/content/SyncResult.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/java/android/content/SyncResult.java b/core/java/android/content/SyncResult.java index 57161b6..3fbe847 100644 --- a/core/java/android/content/SyncResult.java +++ b/core/java/android/content/SyncResult.java @@ -14,6 +14,9 @@ public final class SyncResult implements Parcelable { public boolean fullSyncRequested; public boolean partialSyncUnavailable; public boolean moreRecordsToGet; + + // in seconds since epoch + public long delayUntil; public final SyncStats stats; public static final SyncResult ALREADY_IN_PROGRESS; @@ -32,6 +35,7 @@ public final class SyncResult implements Parcelable { this.fullSyncRequested = false; this.partialSyncUnavailable = false; this.moreRecordsToGet = false; + this.delayUntil = 0; this.stats = new SyncStats(); } @@ -43,6 +47,7 @@ public final class SyncResult implements Parcelable { fullSyncRequested = parcel.readInt() != 0; partialSyncUnavailable = parcel.readInt() != 0; moreRecordsToGet = parcel.readInt() != 0; + delayUntil = parcel.readLong(); stats = new SyncStats(parcel); } @@ -80,6 +85,7 @@ public final class SyncResult implements Parcelable { fullSyncRequested = false; partialSyncUnavailable = false; moreRecordsToGet = false; + delayUntil = 0; stats.clear(); } @@ -105,6 +111,7 @@ public final class SyncResult implements Parcelable { parcel.writeInt(fullSyncRequested ? 1 : 0); parcel.writeInt(partialSyncUnavailable ? 1 : 0); parcel.writeInt(moreRecordsToGet ? 1 : 0); + parcel.writeLong(delayUntil); stats.writeToParcel(parcel, flags); } @@ -123,6 +130,7 @@ public final class SyncResult implements Parcelable { sb.append(" partialSyncUnavailable: ").append(partialSyncUnavailable); } if (moreRecordsToGet) sb.append(" moreRecordsToGet: ").append(moreRecordsToGet); + if (delayUntil > 0) sb.append(" delayUntil: ").append(delayUntil); sb.append(stats); return sb.toString(); } |