Build 1.0_r1(from source)

android.content
Class SyncManager

java.lang.Object
  extended by android.content.SyncManager

 class SyncManager
extends Object


Nested Class Summary
(package private)  class SyncManager.ActiveSyncContext
           
(package private)  class SyncManager.SyncAlarmIntentReceiver
           
(package private)  class SyncManager.SyncHandler
          Handles SyncOperation Messages that are posted to the associated HandlerThread.
(package private)  class SyncManager.SyncHandlerMessagePayload
           
(package private) static class SyncManager.SyncOperation
          Value type that represents a sync operation.
(package private)  class SyncManager.SyncPollAlarmReceiver
           
(package private) static class SyncManager.SyncQueue
           
 
Constructor Summary
SyncManager(Context context, boolean factoryTest)
           
 
Method Summary
 void cancelActiveSync(Uri uri)
          Cancel the active sync if it matches the uri.
 void clearScheduledSyncOperations(Uri uri)
          Remove any scheduled sync operations that match uri.
protected  void dump(FileDescriptor fd, PrintWriter pw)
           
protected  void dumpSyncHistory(StringBuilder sb)
           
protected  void dumpSyncState(StringBuilder sb)
           
 SyncManager.ActiveSyncContext getActiveSyncContext()
           
 String getSyncingAccount()
           
(package private)  void maybeRescheduleSync(SyncResult syncResult, SyncManager.SyncOperation previousSyncOperation)
           
 void scheduleLocalSync(Uri url)
           
 void scheduleSync(Uri url, Bundle extras, long delay)
          Initiate a sync.
 void scheduleSyncOperation(SyncManager.SyncOperation syncOperation)
          Create and schedule a SyncOperation.
 void startSync(Uri url, Bundle extras)
          Initiate a sync for this given URL, or pass null for a full sync.
 void updateHeartbeatTime()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SyncManager

public SyncManager(Context context,
                   boolean factoryTest)
Method Detail

getActiveSyncContext

public SyncManager.ActiveSyncContext getActiveSyncContext()

getSyncingAccount

public String getSyncingAccount()

scheduleSync

public void scheduleSync(Uri url,
                         Bundle extras,
                         long delay)
Initiate a sync. This can start a sync for all providers (pass null to url, set onlyTicklable to false), only those providers that are marked as ticklable (pass null to url, set onlyTicklable to true), or a specific provider (set url to the content url of the provider).

If the ContentResolver.SYNC_EXTRAS_UPLOAD boolean in extras is true then initiate a sync that just checks for local changes to send to the server, otherwise initiate a sync that first gets any changes from the server before sending local changes back to the server.

If a specific provider is being synced (the url is non-null) then the extras can contain SyncAdapter-specific information to control what gets synced (e.g. which specific feed to sync).

You'll start getting callbacks after this.

Parameters:
url - The Uri of a specific provider to be synced, or null to sync all providers.
extras - a Map of SyncAdapter-specific information to control syncs of a specific provider. Can be null. Is ignored if the url is null.
delay - how many milliseconds in the future to wait before performing this sync. -1 means to make this the next sync to perform.

scheduleLocalSync

public void scheduleLocalSync(Uri url)

startSync

public void startSync(Uri url,
                      Bundle extras)
Initiate a sync for this given URL, or pass null for a full sync.

You'll start getting callbacks after this.

Parameters:
url - The Uri of a specific provider to be synced, or null to sync all providers.
extras - a Map of SyncAdapter specific information to control syncs of a specific provider. Can be null. Is ignored

updateHeartbeatTime

public void updateHeartbeatTime()

cancelActiveSync

public void cancelActiveSync(Uri uri)
Cancel the active sync if it matches the uri. The uri corresponds to the one passed in to startSync().

Parameters:
uri - If non-null, the active sync is only canceled if it matches the uri. If null, any active sync is canceled.

scheduleSyncOperation

public void scheduleSyncOperation(SyncManager.SyncOperation syncOperation)
Create and schedule a SyncOperation.

Parameters:
syncOperation - the SyncOperation to schedule

clearScheduledSyncOperations

public void clearScheduledSyncOperations(Uri uri)
Remove any scheduled sync operations that match uri. The uri corresponds to the one passed in to startSync().

Parameters:
uri - If non-null, only operations that match the uri are cleared. If null, all operations are cleared.

maybeRescheduleSync

void maybeRescheduleSync(SyncResult syncResult,
                         SyncManager.SyncOperation previousSyncOperation)

dump

protected void dump(FileDescriptor fd,
                    PrintWriter pw)

dumpSyncState

protected void dumpSyncState(StringBuilder sb)

dumpSyncHistory

protected void dumpSyncHistory(StringBuilder sb)

Build 1.0_r1(from source)

Please submit a feedback, bug or feature