diff options
author | Christopher Tate <ctate@google.com> | 2010-03-29 19:14:24 -0700 |
---|---|---|
committer | Christopher Tate <ctate@google.com> | 2010-03-30 12:42:35 -0700 |
commit | 2d449afe3d075020bdd1115bcc15c9383cbce122 (patch) | |
tree | d7c71c9a74e317319de947f3e3fe3ee673f0c559 /core/java/android/app/backup/RestoreObserver.java | |
parent | ae405d56215e4ab43e8210b66e741a0bf9d5edcf (diff) | |
download | frameworks_base-2d449afe3d075020bdd1115bcc15c9383cbce122.zip frameworks_base-2d449afe3d075020bdd1115bcc15c9383cbce122.tar.gz frameworks_base-2d449afe3d075020bdd1115bcc15c9383cbce122.tar.bz2 |
Make RestoreSession.getAvailableRestoreSets() asynchronous
This transaction can involve the transport having to query a remote backend
over the wire, so it can take a Long Time(tm). Make it main-thread-safe by
making it asynchronous, with the results passed as a callback to the invoker's
RestoreObserver. We also make the IRestoreObserver callback interface
properly oneway.
Bug #2550665
Bug #2549422
Change-Id: If18a233a0a3d54c7b55101715c9e6195b762c5a0
Diffstat (limited to 'core/java/android/app/backup/RestoreObserver.java')
-rw-r--r-- | core/java/android/app/backup/RestoreObserver.java | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/core/java/android/app/backup/RestoreObserver.java b/core/java/android/app/backup/RestoreObserver.java index 0a4ea17..dbddb78 100644 --- a/core/java/android/app/backup/RestoreObserver.java +++ b/core/java/android/app/backup/RestoreObserver.java @@ -17,6 +17,7 @@ package android.app.backup; import java.lang.String; +import android.app.backup.RestoreSet; /** * Callback class for receiving progress reports during a restore operation. These @@ -24,12 +25,27 @@ import java.lang.String; */ public abstract class RestoreObserver { /** + * Supply a list of the restore datasets available from the current transport. This + * method is invoked as a callback following the application's use of the + * {@link android.app.backup.IRestoreSession.getAvailableRestoreSets} method. + * + * @param result An array of {@link android.app.backup.RestoreSet RestoreSet} objects + * describing all of the available datasets that are candidates for restoring to + * the current device. If no applicable datasets exist, {@code result} will be + * {@code null}. + * + * @hide + */ + public void restoreSetsAvailable(RestoreSet[] result) { + } + + /** * The restore operation has begun. * * @param numPackages The total number of packages being processed in * this restore operation. */ - void restoreStarting(int numPackages) { + public void restoreStarting(int numPackages) { } /** @@ -45,7 +61,7 @@ public abstract class RestoreObserver { * indication of the backup manager's progress through the overall restore process. * @param currentPackage The name of the package now being restored. */ - void onUpdate(int nowBeingRestored, String currentPackage) { + public void onUpdate(int nowBeingRestored, String currentPackage) { } /** @@ -55,6 +71,6 @@ public abstract class RestoreObserver { * @param error Zero on success; a nonzero error code if the restore operation * as a whole failed. */ - void restoreFinished(int error) { + public void restoreFinished(int error) { } } |