Android
android.content
public class

android.content.SyncStateContentProviderHelper

java.lang.Object
android.content.SyncStateContentProviderHelper

Extends the schema of a ContentProvider to include the _sync_state table and implements query/insert/update/delete to access that table using the authority "syncstate". This can be used to store the sync state for a set of accounts.

Summary

Public Constructors

            SyncStateContentProviderHelper(SQLiteOpenHelper openHelper)

Public Methods

          ContentProvider  asContentProvider()
          void  copySyncState(SQLiteDatabase dbSrc, SQLiteDatabase dbDest, String account)
Replaces the contents of the _sync_state table in the destination ContentProvider with the row that matches account, if any, in the source ContentProvider.
          void  createDatabase(SQLiteDatabase db)
          void  discardSyncData(SQLiteDatabase db, String account)
          boolean  matches(Uri url)
Check if the url matches content that this ContentProvider manages.
          void  onAccountsChanged(String[] accounts)

Protected Methods

          void  onDatabaseOpened(SQLiteDatabase db)
Methods inherited from class java.lang.Object

Details

Public Constructors

public SyncStateContentProviderHelper(SQLiteOpenHelper openHelper)

Public Methods

public ContentProvider asContentProvider()

public void copySyncState(SQLiteDatabase dbSrc, SQLiteDatabase dbDest, String account)

Replaces the contents of the _sync_state table in the destination ContentProvider with the row that matches account, if any, in the source ContentProvider.

The ContentProviders must expose the _sync_state table as URI content://syncstate/state.

Parameters

dbSrc the database to read from
dbDest the database to write to
account the account of the row that should be copied over.

public void createDatabase(SQLiteDatabase db)

public void discardSyncData(SQLiteDatabase db, String account)

public boolean matches(Uri url)

Check if the url matches content that this ContentProvider manages.

Parameters

url the Uri to check

Returns

  • true if this ContentProvider can handle that Uri.

public void onAccountsChanged(String[] accounts)

Protected Methods

protected void onDatabaseOpened(SQLiteDatabase db)

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