From 0e0b4ae5bc5c652c8339d71ed9667e1e37baaa03 Mon Sep 17 00:00:00 2001 From: Christopher Tate Date: Mon, 10 Aug 2009 16:13:47 -0700 Subject: Don't let bmgr leave a restore session hanging on error Specifically, don't wait for the RestoreObserver to be informed that the restore has completed unless performRestore() ran. We were winding up in a case where bmgr was hanging forever waiting on a nonexistent restore process instead of calling endRestoreSession(). Also improve the documentation, explicitly calling out the need to call endRestoreSession() even if previous operations on the session were unsuccessful. --- core/java/android/backup/IRestoreSession.aidl | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'core/java/android/backup') diff --git a/core/java/android/backup/IRestoreSession.aidl b/core/java/android/backup/IRestoreSession.aidl index 2a1fbc1..fd40d98 100644 --- a/core/java/android/backup/IRestoreSession.aidl +++ b/core/java/android/backup/IRestoreSession.aidl @@ -40,6 +40,8 @@ interface IRestoreSession { * Restore the given set onto the device, replacing the current data of any app * contained in the restore set with the data previously backed up. * + * @return Zero on success; nonzero on error. The observer will only receive + * progress callbacks if this method returned zero. * @param token The token from {@link getAvailableRestoreSets()} corresponding to * the restore set that should be used. * @param observer If non-null, this binder points to an object that will receive @@ -50,6 +52,9 @@ interface IRestoreSession { /** * End this restore session. After this method is called, the IRestoreSession binder * is no longer valid. + * + *

Note: The caller must invoke this method to end the restore session, + * even if {@link getAvailableRestoreSets} or {@link performRestore} failed. */ void endRestoreSession(); } -- cgit v1.1