Android
android.content
public class

android.content.SyncStorageEngine

java.lang.Object
android.content.SyncStorageEngine

ContentProvider that tracks the sync data and overall sync history on the device.

Summary

Public Methods

          int  delete(boolean callerIsTheProvider, Uri url, String where, String[] whereArgs)
Implements the delete(Uri, String, String[]) method
          long  getInitialSyncFailureTime()
If sync is failing for any of the provider/accounts then determine the time at which it started failing and return the earliest time over all the provider/accounts.
          Cursor  getPendingSyncsCursor(String[] projection)
Returns a cursor over all the pending syncs in no particular order.
      static    SyncStorageEngine  getSingleton()
          String  getType(Uri url)
Implements the getType(Uri) method
      static    void  init(Context context)
          Uri  insert(boolean callerIsTheProvider, Uri url, ContentValues values)
Implements the insert(Uri, ContentValues) method
          long  insertStartSyncEvent(String account, String authority, long now, int source)
          Cursor  query(Uri url, String[] projectionIn, String selection, String[] selectionArgs, String sort)
Implements the query(Uri, String[], String, String[], String) method
          void  stopSyncEvent(long historyId, long elapsedTime, String resultMessage, long downstreamActivity, long upstreamActivity)
          int  update(boolean callerIsTheProvider, Uri url, ContentValues initialValues, String where, String[] whereArgs)
Implements the update(Uri, ContentValues, String, String[]) method

Protected Methods

          void  doDatabaseCleanup(String[] accounts)
          Uri  insertIntoPending(ContentValues values)
          void  setActiveSync(SyncManager.ActiveSyncContext activeSyncContext)
Methods inherited from class java.lang.Object

Details

Public Methods

public int delete(boolean callerIsTheProvider, Uri url, String where, String[] whereArgs)

Implements the delete(Uri, String, String[]) method

Parameters

callerIsTheProvider true if this is being called via the delete(Uri, String, String[]) in method rather than directly.

Throws

UnsupportedOperationException if callerIsTheProvider is true and the url isn't for the Settings table.

public long getInitialSyncFailureTime()

If sync is failing for any of the provider/accounts then determine the time at which it started failing and return the earliest time over all the provider/accounts. If none are failing then return 0.

public Cursor getPendingSyncsCursor(String[] projection)

Returns a cursor over all the pending syncs in no particular order. This cursor is not "live", in that if changes are made to the pending table any observers on this cursor will not be notified.

Parameters

projection Return only these columns. If null then all columns are returned.

Returns

  • the cursor of pending syncs

public static SyncStorageEngine getSingleton()

public String getType(Uri url)

Implements the getType(Uri) method

public static void init(Context context)

public Uri insert(boolean callerIsTheProvider, Uri url, ContentValues values)

Implements the insert(Uri, ContentValues) method

Parameters

callerIsTheProvider true if this is being called via the insert(Uri, ContentValues) in method rather than directly.

Throws

UnsupportedOperationException if callerIsTheProvider is true and the url isn't for the Settings table.

public long insertStartSyncEvent(String account, String authority, long now, int source)

public Cursor query(Uri url, String[] projectionIn, String selection, String[] selectionArgs, String sort)

public void stopSyncEvent(long historyId, long elapsedTime, String resultMessage, long downstreamActivity, long upstreamActivity)

public int update(boolean callerIsTheProvider, Uri url, ContentValues initialValues, String where, String[] whereArgs)

Implements the update(Uri, ContentValues, String, String[]) method

Parameters

callerIsTheProvider true if this is being called via the update(Uri, ContentValues, String, String[]) in method rather than directly.

Throws

UnsupportedOperationException if callerIsTheProvider is true and the url isn't for the Settings table.

Protected Methods

protected void doDatabaseCleanup(String[] accounts)

protected Uri insertIntoPending(ContentValues values)

protected void setActiveSync(SyncManager.ActiveSyncContext activeSyncContext)

Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:56