java.lang.Object | |
↳ | android.content.AbstractThreadedSyncAdapter |
An abstract implementation of a SyncAdapter that spawns a thread to invoke a sync operation.
If a sync operation is already in progress when a startSync() request is received then an error
will be returned to the new request and the existing request will be allowed to continue.
When a startSync() is received and there is no sync operation in progress then a thread
will be started to run the operation and onPerformSync(Account, Bundle, String, ContentProviderClient, SyncResult)
will be invoked on that thread.
If a cancelSync() is received that matches an existing sync operation then the thread
that is running that sync operation will be interrupted, which will indicate to the thread
that the sync has been canceled.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | LOG_SYNC_DETAILS | This constant is deprecated. Private constant. May go away in the next release. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates an
AbstractThreadedSyncAdapter . |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Perform a sync for this account.
| |||||||||||
Indicates that a sync operation has been canceled.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
This constant is deprecated.
Private constant. May go away in the next release.
Kernel event log tag. Also listed in data/etc/event-log-tags.
Creates an AbstractThreadedSyncAdapter
.
context | the Context that this is running within. |
---|---|
autoInitialize | if true then sync requests that have
SYNC_EXTRAS_INITIALIZE set will be internally handled by
AbstractThreadedSyncAdapter by calling
setIsSyncable(android.accounts.Account, String, int) with 1 if it
is currently set to <0.
|
Perform a sync for this account. SyncAdapter-specific parameters may be specified in extras, which is guaranteed to not be null. Invocations of this method are guaranteed to be serialized.
account | the account that should be synced |
---|---|
extras | SyncAdapter-specific parameters |
authority | the authority of this sync request |
provider | a ContentProviderClient that points to the ContentProvider for this authority |
syncResult | SyncAdapter-specific parameters |
Indicates that a sync operation has been canceled. This will be invoked on a separate thread than the sync thread and so you must consider the multi-threaded implications of the work that you do in this method.