Build 1.0_r1(from source)

android.content
Class SyncStorageEngine

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

public class SyncStorageEngine
extends Object

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


Field Summary
(package private) static long MILLIS_IN_4WEEKS
           
 
Method Summary
(package private)  int clearPending()
           
 int delete(boolean callerIsTheProvider, Uri url, String where, String[] whereArgs)
          Implements the ContentProvider.delete(android.net.Uri, java.lang.String, java.lang.String[]) method
(package private)  int deleteFromPending(long rowId)
           
protected  void doDatabaseCleanup(String[] accounts)
           
 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 ContentProvider.getType(android.net.Uri) method
static void init(Context context)
           
 Uri insert(boolean callerIsTheProvider, Uri url, ContentValues values)
          Implements the ContentProvider.insert(android.net.Uri, android.content.ContentValues) method
protected  Uri insertIntoPending(ContentValues values)
           
 long insertStartSyncEvent(String account, String authority, long now, int source)
           
static SyncStorageEngine newTestInstance(Context context)
           
 Cursor query(Uri url, String[] projectionIn, String selection, String[] selectionArgs, String sort)
          Implements the ContentProvider.query(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String) method
protected  void setActiveSync(SyncManager.ActiveSyncContext activeSyncContext)
           
 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 ContentProvider.update(android.net.Uri, android.content.ContentValues, java.lang.String, java.lang.String[]) method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MILLIS_IN_4WEEKS

static final long MILLIS_IN_4WEEKS
See Also:
Constant Field Values
Method Detail

newTestInstance

public static SyncStorageEngine newTestInstance(Context context)

init

public static void init(Context context)

getSingleton

public static SyncStorageEngine getSingleton()

doDatabaseCleanup

protected void doDatabaseCleanup(String[] accounts)

setActiveSync

protected void setActiveSync(SyncManager.ActiveSyncContext activeSyncContext)

query

public Cursor query(Uri url,
                    String[] projectionIn,
                    String selection,
                    String[] selectionArgs,
                    String sort)
Implements the ContentProvider.query(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String) method


insert

public Uri insert(boolean callerIsTheProvider,
                  Uri url,
                  ContentValues values)
Implements the ContentProvider.insert(android.net.Uri, android.content.ContentValues) method

Parameters:
callerIsTheProvider - true if this is being called via the ContentProvider.insert(android.net.Uri, android.content.ContentValues) in method rather than directly.
Throws:
UnsupportedOperationException - if callerIsTheProvider is true and the url isn't for the Settings table.

delete

public int delete(boolean callerIsTheProvider,
                  Uri url,
                  String where,
                  String[] whereArgs)
Implements the ContentProvider.delete(android.net.Uri, java.lang.String, java.lang.String[]) method

Parameters:
callerIsTheProvider - true if this is being called via the ContentProvider.delete(android.net.Uri, java.lang.String, java.lang.String[]) in method rather than directly.
Throws:
UnsupportedOperationException - if callerIsTheProvider is true and the url isn't for the Settings table.

update

public int update(boolean callerIsTheProvider,
                  Uri url,
                  ContentValues initialValues,
                  String where,
                  String[] whereArgs)
Implements the ContentProvider.update(android.net.Uri, android.content.ContentValues, java.lang.String, java.lang.String[]) method

Parameters:
callerIsTheProvider - true if this is being called via the ContentProvider.update(android.net.Uri, android.content.ContentValues, java.lang.String, java.lang.String[]) in method rather than directly.
Throws:
UnsupportedOperationException - if callerIsTheProvider is true and the url isn't for the Settings table.

getType

public String getType(Uri url)
Implements the ContentProvider.getType(android.net.Uri) method


insertIntoPending

protected Uri insertIntoPending(ContentValues values)

deleteFromPending

int deleteFromPending(long rowId)

clearPending

int clearPending()

getPendingSyncsCursor

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

insertStartSyncEvent

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

stopSyncEvent

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

getInitialSyncFailureTime

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.


Build 1.0_r1(from source)

Please submit a feedback, bug or feature