public class AccountSyncSettingsBackupHelper extends Object implements BackupHelper
Constructor and Description |
---|
AccountSyncSettingsBackupHelper(Context context) |
Modifier and Type | Method and Description |
---|---|
static void |
accountAdded(Context context)
Restore SyncSettings for all existing accounts from a stashed backup-set
|
void |
performBackup(ParcelFileDescriptor oldState,
BackupDataOutput output,
ParcelFileDescriptor newState)
Take a snapshot of the current account sync settings and write them to the given output.
|
void |
restoreEntity(BackupDataInputStream data)
Restore account sync settings from the given data input stream.
|
void |
writeNewStateDescription(ParcelFileDescriptor newState)
Called by
BackupAgentHelper
after a restore operation to write the backup state file corresponding to
the data as processed by the helper. |
public AccountSyncSettingsBackupHelper(Context context)
public void performBackup(ParcelFileDescriptor oldState, BackupDataOutput output, ParcelFileDescriptor newState)
performBackup
in interface BackupHelper
oldState
- An open, read-only ParcelFileDescriptor
pointing to the
last backup state provided by the application. May be
null
, in which case no prior state is being
provided and the application should perform a full backup.output
- An open, read/write BackupDataOutput
pointing to the backup data destination.
Typically the application will use backup helper classes to
write to this file.newState
- An open, read/write ParcelFileDescriptor
pointing to an
empty file. The application should record the final backup
state here after writing the requested data to the data
output stream.public void restoreEntity(BackupDataInputStream data)
restoreEntity
in interface BackupHelper
data
- An open BackupDataInputStream
from which the backup data can be read.public static void accountAdded(Context context)
public void writeNewStateDescription(ParcelFileDescriptor newState)
BackupHelper
BackupAgentHelper
after a restore operation to write the backup state file corresponding to
the data as processed by the helper. The data written here will be
available to the helper during the next call to its
performBackup()
method.
This method will be called even if the handler's
restoreEntity()
method was never invoked during
the restore operation.
Note: The helper should not close or seek the newState
file descriptor.
writeNewStateDescription
in interface BackupHelper
newState
- A ParcelFileDescriptor
to which the new state will be
written.