public final class SyncResult extends Object implements Parcelable
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static SyncResult |
ALREADY_IN_PROGRESS
This instance of a SyncResult is returned by the SyncAdapter in response to a
sync request when a sync is already underway.
|
static Parcelable.Creator<SyncResult> |
CREATOR |
boolean |
databaseError
Used to indicate that the SyncAdapter experienced a hard error due to an error it
received from interacting with the storage layer.
|
long |
delayUntil
Used to indicate to the SyncManager that future sync requests that match the request's
Account and authority should be delayed at least this many seconds.
|
boolean |
fullSyncRequested
If set the SyncManager will request an immediate sync with the same Account and authority
(but empty extras Bundle) as was used in the sync request.
|
boolean |
moreRecordsToGet
This field is ignored by the SyncManager.
|
boolean |
partialSyncUnavailable
This field is ignored by the SyncManager.
|
SyncStats |
stats
Used to hold extras statistics about the sync operation.
|
boolean |
syncAlreadyInProgress
Used to indicate that the SyncAdapter is already performing a sync operation, though
not necessarily for the requested account and authority and that it wasn't able to
process this request.
|
boolean |
tooManyDeletions
Used to indicate that the SyncAdapter determined that it would need to issue
too many delete operations to the server in order to satisfy the request
(as defined by the SyncAdapter).
|
boolean |
tooManyRetries
Used to indicate that the SyncAdapter experienced a hard error due to trying the same
operation too many times (as defined by the SyncAdapter).
|
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
SyncResult()
Create a "clean" SyncResult.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the SyncResult to a clean state.
|
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation.
|
boolean |
hasError()
A convenience method for determining of the SyncResult indicates that an error occurred.
|
boolean |
hasHardError()
Convenience method for determining if the SyncResult indicates that a hard error
occurred.
|
boolean |
hasSoftError()
Convenience method for determining if the SyncResult indicates that a soft error
occurred.
|
boolean |
madeSomeProgress()
Convenience method for determining if the Sync should be rescheduled after failing for some
reason.
|
String |
toDebugString()
Generates a debugging string indicating the status.
|
String |
toString()
Returns a string representation of the object.
|
void |
writeToParcel(Parcel parcel,
int flags)
Flatten this object in to a Parcel.
|
public final boolean syncAlreadyInProgress
public boolean tooManyDeletions
ContentResolver.SYNC_EXTRAS_OVERRIDE_TOO_MANY_DELETIONS
or ContentResolver.SYNC_EXTRAS_DISCARD_LOCAL_DELETIONS
set in the extras.
It is then up to the SyncAdapter to decide how to honor that request.public boolean tooManyRetries
public boolean databaseError
public boolean fullSyncRequested
public boolean partialSyncUnavailable
public boolean moreRecordsToGet
public long delayUntil
public final SyncStats stats
public static final SyncResult ALREADY_IN_PROGRESS
public static final Parcelable.Creator<SyncResult> CREATOR
public SyncResult()
The errors are classified into two broad categories: hard errors and soft errors.
Soft errors are retried with exponential backoff. Hard errors are not retried (except
when the hard error is for a ContentResolver.SYNC_EXTRAS_UPLOAD
request,
in which the request is retryed without the ContentResolver.SYNC_EXTRAS_UPLOAD
extra set). The SyncManager checks the type of error by calling
hasHardError()
and hasSoftError()
. If both are
true then the SyncManager treats it as a hard error, not a soft error.
public boolean hasHardError()
SyncResult()
for an explanation of what the SyncManager does
when it sees a hard error.
A hard error is indicated when any of the following is true:
public boolean hasSoftError()
SyncResult()
for an explanation of what the SyncManager does
when it sees a soft error.
A soft error is indicated when any of the following is true:
public boolean hasError()
public boolean madeSomeProgress()
public void clear()
UnsupportedOperationException
if this is called when syncAlreadyInProgress
is set.public int describeContents()
Parcelable
Parcelable.writeToParcel(Parcel, int)
,
the return value of this method must include the
Parcelable.CONTENTS_FILE_DESCRIPTOR
bit.describeContents
in interface Parcelable
Parcelable.CONTENTS_FILE_DESCRIPTOR
public void writeToParcel(Parcel parcel, int flags)
Parcelable
writeToParcel
in interface Parcelable
parcel
- The Parcel in which the object should be written.flags
- Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE
.public String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
public String toDebugString()