Methods Summary |
---|
protected abstract void | bootstrapDatabase(android.database.sqlite.SQLiteDatabase db)Override to create your schema and do anything else you need to do with a new database.
This is run inside a transaction (so you don't need to use one).
This method may not use getDatabase(), or call content provider methods, it must only
use the database handle passed to it.
|
public abstract boolean | changeRequiresLocalSync(android.net.Uri uri)Check if changes to this URI can be syncable changes.
|
public abstract void | close()Close resources that must be closed. You must call this to properly release
the resources used by the SyncableContentProvider.
|
protected abstract int | deleteInternal(android.net.Uri url, java.lang.String selection, java.lang.String[] selectionArgs)Subclasses should override this instead of delete(). See delete()
for details.
This method is called within a acquireDbLock()/releaseDbLock() block,
which means a database transaction will be active during the call;
|
protected abstract void | deleteRowsForRemovedAccounts(java.util.Map accounts, java.lang.String table, java.lang.String accountColumnName)A helper method to delete all rows whose account is not in the accounts
map. The accountColumnName is the name of the column that is expected
to hold the account. If a row has an empty account it is never deleted.
|
public abstract boolean | getContainsDiffs()
|
public abstract android.database.sqlite.SQLiteDatabase | getDatabase()
|
protected abstract java.lang.Iterable | getMergers()Each subclass of this class should define a subclass of {@link
AbstractTableMerger} for each table they wish to merge. It
should then override this method and return one instance of
each merger, in sequence. Their {@link
AbstractTableMerger#merge merge} methods will be called, one at a
time, in the order supplied.
The default implementation returns an empty list, so that no
merging will occur.
|
public abstract java.lang.String | getSyncingAccount()The account of the most recent call to onSyncStart()
|
public abstract android.content.SyncableContentProvider | getTemporaryInstance()Get a non-persistent instance of this content provider.
You must call {@link #close} on the returned
SyncableContentProvider when you are done with it.
|
protected abstract android.net.Uri | insertInternal(android.net.Uri url, ContentValues values)Subclasses should override this instead of insert(). See insert()
for details.
This method is called within a acquireDbLock()/releaseDbLock() block,
which means a database transaction will be active during the call;
|
public abstract boolean | isMergeCancelled()
|
protected abstract boolean | isTemporary()
|
public abstract void | merge(SyncContext context, android.content.SyncableContentProvider diffs, TempProviderSyncResult result, SyncResult syncResult)Merge diffs from a sync source with this content provider.
|
protected abstract void | onAccountsChanged(java.lang.String[] accountsArray)Make sure that there are no entries for accounts that no longer exist
|
protected abstract void | onDatabaseOpened(android.database.sqlite.SQLiteDatabase db)Override to do anything (like cleanups or checks) you need to do after opening a database.
Does nothing by default. This is run inside a transaction (so you don't need to use one).
This method may not use getDatabase(), or call content provider methods, it must only
use the database handle passed to it.
|
public abstract void | onSyncCanceled()Invoked when the active sync has been canceled. The default
implementation doesn't do anything (except ensure that this
provider is syncable). Subclasses of ContentProvider
that support canceling of sync should override this.
|
public abstract void | onSyncStart(SyncContext context, java.lang.String account)Called right before a sync is started.
|
public abstract void | onSyncStop(SyncContext context, boolean success)Called right after a sync is completed
|
protected abstract android.database.Cursor | queryInternal(android.net.Uri url, java.lang.String[] projection, java.lang.String selection, java.lang.String[] selectionArgs, java.lang.String sortOrder)Subclasses should override this instead of query(). See query()
for details.
This method is *not* called within a acquireDbLock()/releaseDbLock()
block for performance reasons. If an implementation needs atomic access
to the database the lock can be acquired then.
|
public abstract byte[] | readSyncDataBytes(java.lang.String account)Retrieves the SyncData bytes for the given account. The byte array returned may be null.
|
public abstract void | setContainsDiffs(boolean containsDiffs)
|
protected abstract int | updateInternal(android.net.Uri url, ContentValues values, java.lang.String selection, java.lang.String[] selectionArgs)Subclasses should override this instead of update(). See update()
for details.
This method is called within a acquireDbLock()/releaseDbLock() block,
which means a database transaction will be active during the call;
|
protected abstract boolean | upgradeDatabase(android.database.sqlite.SQLiteDatabase db, int oldVersion, int newVersion)Override to upgrade your database from an old version to the version you specified.
Don't set the DB version, this will automatically be done after the method returns.
This method may not use getDatabase(), or call content provider methods, it must only
use the database handle passed to it.
|
public abstract void | wipeAccount(java.lang.String account)Called when the sync system determines that this provider should no longer
contain records for the specified account.
|
public abstract void | writeSyncDataBytes(java.lang.String account, byte[] data)Sets the SyncData bytes for the given account. The bytes array may be null.
|