diff options
| author | 2009-05-08 11:12:34 -0700 | |
|---|---|---|
| committer | 2009-05-08 11:12:34 -0700 | |
| commit | 17f9599fd619f728b34a3b21de6ad636b3253ed3 (patch) | |
| tree | b63dc5d44fca14cfa4c713ca56ee469dc308e483 | |
| parent | 7e38146b8440acb5317cb5b1b9cc1b6a7cc1930a (diff) | |
| parent | 17a5e5de3d864842b723efe24650863db0656a14 (diff) | |
am 17a5e5d: Merge change 1217 into donut
Merge commit '17a5e5de3d864842b723efe24650863db0656a14'
* commit '17a5e5de3d864842b723efe24650863db0656a14':
Sketch out the IBackupTransport api
| -rw-r--r-- | core/java/com/android/internal/backup/IBackupTransport.aidl | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/core/java/com/android/internal/backup/IBackupTransport.aidl b/core/java/com/android/internal/backup/IBackupTransport.aidl index d64a3032f075..ce39768137e2 100644 --- a/core/java/com/android/internal/backup/IBackupTransport.aidl +++ b/core/java/com/android/internal/backup/IBackupTransport.aidl @@ -16,6 +16,54 @@ package com.android.internal.backup; +import android.os.ParcelFileDescriptor; + /** {@hide} */ interface IBackupTransport { +/* STOPSHIP - don't ship with this comment in place + Things the transport interface has to do: + 1. set up the connection to the destination + - set up encryption + - for Google cloud, log in using the user's gaia credential or whatever + - for sd, spin off the backup transport and establish communication with it + 2. send each app's backup transaction + - parse the data file for key/value pointers etc + - send key/blobsize set to the Google cloud, get back quota ok/rejected response + - sd/adb doesn't preflight; no per-app quota + - app's entire change is essentially atomic + - cloud transaction encrypts then sends each key/value pair separately; we already + parsed the data when preflighting so we don't have to again here + - sd target streams raw data into encryption envelope then to sd? + 3. shut down connection to destination + - cloud: tear down connection etc + - sd: close the file and shut down the writer proxy +*/ + /** + * Establish a connection to the back-end data repository, if necessary. If the transport + * needs to initialize state that is not tied to individual applications' backup operations, + * this is where it should be done. + * + * @return Zero on success; a nonzero error code on failure. + */ + int startSession(); + + /** + * Send one application's data to the backup destination. + * + * @param packageName The identity of the application whose data is being backed up. + * @param data The data stream that resulted from invoking the application's + * BackupService.doBackup() method. This may be a pipe rather than a + * file on persistent media, so it may not be seekable. + * @return Zero on success; a nonzero error code on failure. + */ + int performBackup(String packageName, in ParcelFileDescriptor data); + + /** + * Terminate the backup session, closing files, freeing memory, and cleaning up whatever + * other state the transport required. + * + * @return Zero on success; a nonzero error code on failure. Even on failure, the session + * is torn down and must be restarted if another backup is attempted. + */ + int endSession(); } |