1 /*
2  * Copyright (C) 2014 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.app.backup;
18 
19 import android.annotation.SystemApi;
20 import android.content.Intent;
21 import android.content.pm.PackageInfo;
22 import android.os.IBinder;
23 import android.os.ParcelFileDescriptor;
24 import android.os.RemoteException;
25 
26 import com.android.internal.backup.IBackupTransport;
27 
28 /**
29  * Concrete class that provides a stable-API bridge between IBackupTransport
30  * and its implementations.
31  *
32  * @hide
33  */
34 @SystemApi
35 public class BackupTransport {
36     // Zero return always means things are okay.  If returned from
37     // getNextFullRestoreDataChunk(), it means that no data could be delivered at
38     // this time, but the restore is still running and the caller should simply
39     // retry.
40     public static final int TRANSPORT_OK = 0;
41 
42     // -1 is special; it is used in getNextFullRestoreDataChunk() to indicate that
43     // we've delivered the entire data stream for the current restore target.
44     public static final int NO_MORE_DATA = -1;
45 
46     // Result codes that indicate real errors are negative and not -1
47     public static final int TRANSPORT_ERROR = -1000;
48     public static final int TRANSPORT_NOT_INITIALIZED = -1001;
49     public static final int TRANSPORT_PACKAGE_REJECTED = -1002;
50     public static final int AGENT_ERROR = -1003;
51     public static final int AGENT_UNKNOWN = -1004;
52 
53     IBackupTransport mBinderImpl = new TransportImpl();
54 
getBinder()55     public IBinder getBinder() {
56         return mBinderImpl.asBinder();
57     }
58 
59     // ------------------------------------------------------------------------------------
60     // Transport self-description and general configuration interfaces
61     //
62 
63     /**
64      * Ask the transport for the name under which it should be registered.  This will
65      * typically be its host service's component name, but need not be.
66      */
name()67     public String name() {
68         throw new UnsupportedOperationException("Transport name() not implemented");
69     }
70 
71     /**
72      * Ask the transport for an Intent that can be used to launch any internal
73      * configuration Activity that it wishes to present.  For example, the transport
74      * may offer a UI for allowing the user to supply login credentials for the
75      * transport's off-device backend.
76      *
77      * <p>If the transport does not supply any user-facing configuration UI, it should
78      * return {@code null} from this method.
79      *
80      * @return An Intent that can be passed to Context.startActivity() in order to
81      *         launch the transport's configuration UI.  This method will return {@code null}
82      *         if the transport does not offer any user-facing configuration UI.
83      */
configurationIntent()84     public Intent configurationIntent() {
85         return null;
86     }
87 
88     /**
89      * On demand, supply a one-line string that can be shown to the user that
90      * describes the current backend destination.  For example, a transport that
91      * can potentially associate backup data with arbitrary user accounts should
92      * include the name of the currently-active account here.
93      *
94      * @return A string describing the destination to which the transport is currently
95      *         sending data.  This method should not return null.
96      */
currentDestinationString()97     public String currentDestinationString() {
98         throw new UnsupportedOperationException(
99                 "Transport currentDestinationString() not implemented");
100     }
101 
102     /**
103      * Ask the transport for an Intent that can be used to launch a more detailed
104      * secondary data management activity.  For example, the configuration intent might
105      * be one for allowing the user to select which account they wish to associate
106      * their backups with, and the management intent might be one which presents a
107      * UI for managing the data on the backend.
108      *
109      * <p>In the Settings UI, the configuration intent will typically be invoked
110      * when the user taps on the preferences item labeled with the current
111      * destination string, and the management intent will be placed in an overflow
112      * menu labelled with the management label string.
113      *
114      * <p>If the transport does not supply any user-facing data management
115      * UI, then it should return {@code null} from this method.
116      *
117      * @return An intent that can be passed to Context.startActivity() in order to
118      *         launch the transport's data-management UI.  This method will return
119      *         {@code null} if the transport does not offer any user-facing data
120      *         management UI.
121      */
dataManagementIntent()122     public Intent dataManagementIntent() {
123         return null;
124     }
125 
126     /**
127      * On demand, supply a short string that can be shown to the user as the label
128      * on an overflow menu item used to invoked the data management UI.
129      *
130      * @return A string to be used as the label for the transport's data management
131      *         affordance.  If the transport supplies a data management intent, this
132      *         method must not return {@code null}.
133      */
dataManagementLabel()134     public String dataManagementLabel() {
135         throw new UnsupportedOperationException(
136                 "Transport dataManagementLabel() not implemented");
137     }
138 
139     /**
140      * Ask the transport where, on local device storage, to keep backup state blobs.
141      * This is per-transport so that mock transports used for testing can coexist with
142      * "live" backup services without interfering with the live bookkeeping.  The
143      * returned string should be a name that is expected to be unambiguous among all
144      * available backup transports; the name of the class implementing the transport
145      * is a good choice.
146      *
147      * @return A unique name, suitable for use as a file or directory name, that the
148      *         Backup Manager could use to disambiguate state files associated with
149      *         different backup transports.
150      */
transportDirName()151     public String transportDirName() {
152         throw new UnsupportedOperationException(
153                 "Transport transportDirName() not implemented");
154     }
155 
156     // ------------------------------------------------------------------------------------
157     // Device-level operations common to both key/value and full-data storage
158 
159     /**
160      * Initialize the server side storage for this device, erasing all stored data.
161      * The transport may send the request immediately, or may buffer it.  After
162      * this is called, {@link #finishBackup} will be called to ensure the request
163      * is sent and received successfully.
164      *
165      * <p>If the transport returns anything other than TRANSPORT_OK from this method,
166      * the OS will halt the current initialize operation and schedule a retry in the
167      * near future.  Even if the transport is in a state such that attempting to
168      * "initialize" the backend storage is meaningless -- for example, if there is
169      * no current live dataset at all, or there is no authenticated account under which
170      * to store the data remotely -- the transport should return TRANSPORT_OK here
171      * and treat the initializeDevice() / finishBackup() pair as a graceful no-op.
172      *
173      * @return One of {@link BackupTransport#TRANSPORT_OK} (OK so far) or
174      *   {@link BackupTransport#TRANSPORT_ERROR} (to retry following network error
175      *   or other failure).
176      */
initializeDevice()177     public int initializeDevice() {
178         return BackupTransport.TRANSPORT_ERROR;
179     }
180 
181     /**
182      * Erase the given application's data from the backup destination.  This clears
183      * out the given package's data from the current backup set, making it as though
184      * the app had never yet been backed up.  After this is called, {@link finishBackup}
185      * must be called to ensure that the operation is recorded successfully.
186      *
187      * @return the same error codes as {@link #performBackup}.
188      */
clearBackupData(PackageInfo packageInfo)189     public int clearBackupData(PackageInfo packageInfo) {
190         return BackupTransport.TRANSPORT_ERROR;
191     }
192 
193     /**
194      * Finish sending application data to the backup destination.  This must be
195      * called after {@link #performBackup}, {@link #performFullBackup}, or {@link clearBackupData}
196      * to ensure that all data is sent and the operation properly finalized.  Only when this
197      * method returns true can a backup be assumed to have succeeded.
198      *
199      * @return the same error codes as {@link #performBackup} or {@link #performFullBackup}.
200      */
finishBackup()201     public int finishBackup() {
202         return BackupTransport.TRANSPORT_ERROR;
203     }
204 
205     // ------------------------------------------------------------------------------------
206     // Key/value incremental backup support interfaces
207 
208     /**
209      * Verify that this is a suitable time for a key/value backup pass.  This should return zero
210      * if a backup is reasonable right now, some positive value otherwise.  This method
211      * will be called outside of the {@link #performBackup}/{@link #finishBackup} pair.
212      *
213      * <p>If this is not a suitable time for a backup, the transport should return a
214      * backoff delay, in milliseconds, after which the Backup Manager should try again.
215      *
216      * @return Zero if this is a suitable time for a backup pass, or a positive time delay
217      *   in milliseconds to suggest deferring the backup pass for a while.
218      */
requestBackupTime()219     public long requestBackupTime() {
220         return 0;
221     }
222 
223     /**
224      * Send one application's key/value data update to the backup destination.  The
225      * transport may send the data immediately, or may buffer it.  If this method returns
226      * {@link #TRANSPORT_OK}, {@link #finishBackup} will then be called to ensure the data
227      * is sent and recorded successfully.
228      *
229      * @param packageInfo The identity of the application whose data is being backed up.
230      *   This specifically includes the signature list for the package.
231      * @param data The data stream that resulted from invoking the application's
232      *   BackupService.doBackup() method.  This may be a pipe rather than a file on
233      *   persistent media, so it may not be seekable.
234      * @param wipeAllFirst When true, <i>all</i> backed-up data for the current device/account
235      *   must be erased prior to the storage of the data provided here.  The purpose of this
236      *   is to provide a guarantee that no stale data exists in the restore set when the
237      *   device begins providing incremental backups.
238      * @return one of {@link BackupTransport#TRANSPORT_OK} (OK so far),
239      *  {@link BackupTransport#TRANSPORT_PACKAGE_REJECTED} (to suppress backup of this
240      *  specific package, but allow others to proceed),
241      *  {@link BackupTransport#TRANSPORT_ERROR} (on network error or other failure), or
242      *  {@link BackupTransport#TRANSPORT_NOT_INITIALIZED} (if the backend dataset has
243      *  become lost due to inactivity purge or some other reason and needs re-initializing)
244      */
performBackup(PackageInfo packageInfo, ParcelFileDescriptor inFd)245     public int performBackup(PackageInfo packageInfo, ParcelFileDescriptor inFd) {
246         return BackupTransport.TRANSPORT_ERROR;
247     }
248 
249     // ------------------------------------------------------------------------------------
250     // Key/value dataset restore interfaces
251 
252     /**
253      * Get the set of all backups currently available over this transport.
254      *
255      * @return Descriptions of the set of restore images available for this device,
256      *   or null if an error occurred (the attempt should be rescheduled).
257      **/
getAvailableRestoreSets()258     public RestoreSet[] getAvailableRestoreSets() {
259         return null;
260     }
261 
262     /**
263      * Get the identifying token of the backup set currently being stored from
264      * this device.  This is used in the case of applications wishing to restore
265      * their last-known-good data.
266      *
267      * @return A token that can be passed to {@link #startRestore}, or 0 if there
268      *   is no backup set available corresponding to the current device state.
269      */
getCurrentRestoreSet()270     public long getCurrentRestoreSet() {
271         return 0;
272     }
273 
274     /**
275      * Start restoring application data from backup.  After calling this function,
276      * alternate calls to {@link #nextRestorePackage} and {@link #nextRestoreData}
277      * to walk through the actual application data.
278      *
279      * @param token A backup token as returned by {@link #getAvailableRestoreSets}
280      *   or {@link #getCurrentRestoreSet}.
281      * @param packages List of applications to restore (if data is available).
282      *   Application data will be restored in the order given.
283      * @return One of {@link BackupTransport#TRANSPORT_OK} (OK so far, call
284      *   {@link #nextRestorePackage}) or {@link BackupTransport#TRANSPORT_ERROR}
285      *   (an error occurred, the restore should be aborted and rescheduled).
286      */
startRestore(long token, PackageInfo[] packages)287     public int startRestore(long token, PackageInfo[] packages) {
288         return BackupTransport.TRANSPORT_ERROR;
289     }
290 
291     /**
292      * Get the package name of the next application with data in the backup store, plus
293      * a description of the structure of the restored archive: either TYPE_KEY_VALUE for
294      * an original-API key/value dataset, or TYPE_FULL_STREAM for a tarball-type archive stream.
295      *
296      * <p>If the package name in the returned RestoreDescription object is the singleton
297      * {@link RestoreDescription#NO_MORE_PACKAGES}, it indicates that no further data is available
298      * in the current restore session: all packages described in startRestore() have been
299      * processed.
300      *
301      * <p>If this method returns {@code null}, it means that a transport-level error has
302      * occurred and the entire restore operation should be abandoned.
303      *
304      * <p class="note">The OS may call {@link #nextRestorePackage()} multiple times
305      * before calling either {@link #getRestoreData(ParcelFileDescriptor) getRestoreData()}
306      * or {@link #getNextFullRestoreDataChunk(ParcelFileDescriptor) getNextFullRestoreDataChunk()}.
307      * It does this when it has determined that it needs to skip restore of one or more
308      * packages.  The transport should not actually transfer any restore data for
309      * the given package in response to {@link #nextRestorePackage()}, but rather wait
310      * for an explicit request before doing so.
311      *
312      * @return A RestoreDescription object containing the name of one of the packages
313      *   supplied to {@link #startRestore} plus an indicator of the data type of that
314      *   restore data; or {@link RestoreDescription#NO_MORE_PACKAGES} to indicate that
315      *   no more packages can be restored in this session; or {@code null} to indicate
316      *   a transport-level error.
317      */
nextRestorePackage()318     public RestoreDescription nextRestorePackage() {
319         return null;
320     }
321 
322     /**
323      * Get the data for the application returned by {@link #nextRestorePackage}, if that
324      * method reported {@link RestoreDescription#TYPE_KEY_VALUE} as its delivery type.
325      * If the package has only TYPE_FULL_STREAM data, then this method will return an
326      * error.
327      *
328      * @param data An open, writable file into which the key/value backup data should be stored.
329      * @return the same error codes as {@link #startRestore}.
330      */
getRestoreData(ParcelFileDescriptor outFd)331     public int getRestoreData(ParcelFileDescriptor outFd) {
332         return BackupTransport.TRANSPORT_ERROR;
333     }
334 
335     /**
336      * End a restore session (aborting any in-process data transfer as necessary),
337      * freeing any resources and connections used during the restore process.
338      */
finishRestore()339     public void finishRestore() {
340         throw new UnsupportedOperationException(
341                 "Transport finishRestore() not implemented");
342     }
343 
344     // ------------------------------------------------------------------------------------
345     // Full backup interfaces
346 
347     /**
348      * Verify that this is a suitable time for a full-data backup pass.  This should return zero
349      * if a backup is reasonable right now, some positive value otherwise.  This method
350      * will be called outside of the {@link #performFullBackup}/{@link #finishBackup} pair.
351      *
352      * <p>If this is not a suitable time for a backup, the transport should return a
353      * backoff delay, in milliseconds, after which the Backup Manager should try again.
354      *
355      * @return Zero if this is a suitable time for a backup pass, or a positive time delay
356      *   in milliseconds to suggest deferring the backup pass for a while.
357      *
358      * @see #requestBackupTime()
359      */
requestFullBackupTime()360     public long requestFullBackupTime() {
361         return 0;
362     }
363 
364     /**
365      * Begin the process of sending an application's full-data archive to the backend.
366      * The description of the package whose data will be delivered is provided, as well as
367      * the socket file descriptor on which the transport will receive the data itself.
368      *
369      * <p>If the package is not eligible for backup, the transport should return
370      * {@link BackupTransport#TRANSPORT_PACKAGE_REJECTED}.  In this case the system will
371      * simply proceed with the next candidate if any, or finish the full backup operation
372      * if all apps have been processed.
373      *
374      * <p>After the transport returns {@link BackupTransport#TRANSPORT_OK} from this
375      * method, the OS will proceed to call {@link #sendBackupData()} one or more times
376      * to deliver the application's data as a streamed tarball.  The transport should not
377      * read() from the socket except as instructed to via the {@link #sendBackupData(int)}
378      * method.
379      *
380      * <p>After all data has been delivered to the transport, the system will call
381      * {@link #finishBackup()}.  At this point the transport should commit the data to
382      * its datastore, if appropriate, and close the socket that had been provided in
383      * {@link #performFullBackup(PackageInfo, ParcelFileDescriptor)}.
384      *
385      * <p class="note">If the transport returns TRANSPORT_OK from this method, then the
386      * OS will always provide a matching call to {@link #finishBackup()} even if sending
387      * data via {@link #sendBackupData(int)} failed at some point.
388      *
389      * @param targetPackage The package whose data is to follow.
390      * @param socket The socket file descriptor through which the data will be provided.
391      *    If the transport returns {@link #TRANSPORT_PACKAGE_REJECTED} here, it must still
392      *    close this file descriptor now; otherwise it should be cached for use during
393      *    succeeding calls to {@link #sendBackupData(int)}, and closed in response to
394      *    {@link #finishBackup()}.
395      * @return TRANSPORT_PACKAGE_REJECTED to indicate that the stated application is not
396      *    to be backed up; TRANSPORT_OK to indicate that the OS may proceed with delivering
397      *    backup data; TRANSPORT_ERROR to indicate a fatal error condition that precludes
398      *    performing a backup at this time.
399      */
performFullBackup(PackageInfo targetPackage, ParcelFileDescriptor socket)400     public int performFullBackup(PackageInfo targetPackage, ParcelFileDescriptor socket) {
401         return BackupTransport.TRANSPORT_PACKAGE_REJECTED;
402     }
403 
404     /**
405      * Called after {@link #performFullBackup} to make sure that the transport is willing to
406      * handle a full-data backup operation of the specified size on the current package.
407      * If the transport returns anything other than TRANSPORT_OK, the package's backup
408      * operation will be skipped (and {@link #finishBackup() invoked} with no data for that
409      * package being passed to {@link #sendBackupData}.
410      *
411      * <p class="note">The platform does no size-based rejection of full backup attempts on
412      * its own: it is always the responsibility of the transport to implement its own policy.
413      * In particular, even if the preflighted payload size is zero, the platform will still call
414      * this method and will proceed to back up an archive metadata header with no file content
415      * if this method returns TRANSPORT_OK.  To avoid storing such payloads the transport
416      * must recognize this case and return TRANSPORT_PACKAGE_REJECTED.
417      *
418      * Added in {@link android.os.Build.VERSION_CODES#M}.
419      *
420      * @param size The estimated size of the full-data payload for this app.  This includes
421      *         manifest and archive format overhead, but is not guaranteed to be precise.
422      * @return TRANSPORT_OK if the platform is to proceed with the full-data backup,
423      *         TRANSPORT_PACKAGE_REJECTED if the proposed payload size is too large for
424      *         the transport to handle, or TRANSPORT_ERROR to indicate a fatal error
425      *         condition that means the platform cannot perform a backup at this time.
426      */
checkFullBackupSize(long size)427     public int checkFullBackupSize(long size) {
428         return BackupTransport.TRANSPORT_OK;
429     }
430 
431     /**
432      * Tells the transport to read {@code numBytes} bytes of data from the socket file
433      * descriptor provided in the {@link #performFullBackup(PackageInfo, ParcelFileDescriptor)}
434      * call, and deliver those bytes to the datastore.
435      *
436      * @param numBytes The number of bytes of tarball data available to be read from the
437      *    socket.
438      * @return TRANSPORT_OK on successful processing of the data; TRANSPORT_ERROR to
439      *    indicate a fatal error situation.  If an error is returned, the system will
440      *    call finishBackup() and stop attempting backups until after a backoff and retry
441      *    interval.
442      */
sendBackupData(int numBytes)443     public int sendBackupData(int numBytes) {
444         return BackupTransport.TRANSPORT_ERROR;
445     }
446 
447     /**
448      * Tells the transport to cancel the currently-ongoing full backup operation.  This
449      * will happen between {@link #performFullBackup()} and {@link #finishBackup()}
450      * if the OS needs to abort the backup operation for any reason, such as a crash in
451      * the application undergoing backup.
452      *
453      * <p>When it receives this call, the transport should discard any partial archive
454      * that it has stored so far.  If possible it should also roll back to the previous
455      * known-good archive in its datastore.
456      *
457      * <p>If the transport receives this callback, it will <em>not</em> receive a
458      * call to {@link #finishBackup()}.  It needs to tear down any ongoing backup state
459      * here.
460      */
cancelFullBackup()461     public void cancelFullBackup() {
462         throw new UnsupportedOperationException(
463                 "Transport cancelFullBackup() not implemented");
464     }
465 
466     // ------------------------------------------------------------------------------------
467     // Full restore interfaces
468 
469     /**
470      * Ask the transport to provide data for the "current" package being restored.  This
471      * is the package that was just reported by {@link #nextRestorePackage()} as having
472      * {@link RestoreDescription#TYPE_FULL_STREAM} data.
473      *
474      * The transport writes some data to the socket supplied to this call, and returns
475      * the number of bytes written.  The system will then read that many bytes and
476      * stream them to the application's agent for restore, then will call this method again
477      * to receive the next chunk of the archive.  This sequence will be repeated until the
478      * transport returns zero indicating that all of the package's data has been delivered
479      * (or returns a negative value indicating some sort of hard error condition at the
480      * transport level).
481      *
482      * <p>After this method returns zero, the system will then call
483      * {@link #nextRestorePackage()} to begin the restore process for the next
484      * application, and the sequence begins again.
485      *
486      * <p>The transport should always close this socket when returning from this method.
487      * Do not cache this socket across multiple calls or you may leak file descriptors.
488      *
489      * @param socket The file descriptor that the transport will use for delivering the
490      *    streamed archive.  The transport must close this socket in all cases when returning
491      *    from this method.
492      * @return {@link #NO_MORE_DATA} when no more data for the current package is available.
493      *    A positive value indicates the presence of that many bytes to be delivered to the app.
494      *    A value of zero indicates that no data was deliverable at this time, but the restore
495      *    is still running and the caller should retry.  {@link #TRANSPORT_PACKAGE_REJECTED}
496      *    means that the current package's restore operation should be aborted, but that
497      *    the transport itself is still in a good state and so a multiple-package restore
498      *    sequence can still be continued.  Any other negative return value is treated as a
499      *    fatal error condition that aborts all further restore operations on the current dataset.
500      */
getNextFullRestoreDataChunk(ParcelFileDescriptor socket)501     public int getNextFullRestoreDataChunk(ParcelFileDescriptor socket) {
502         return 0;
503     }
504 
505     /**
506      * If the OS encounters an error while processing {@link RestoreDescription#TYPE_FULL_STREAM}
507      * data for restore, it will invoke this method to tell the transport that it should
508      * abandon the data download for the current package.  The OS will then either call
509      * {@link #nextRestorePackage()} again to move on to restoring the next package in the
510      * set being iterated over, or will call {@link #finishRestore()} to shut down the restore
511      * operation.
512      *
513      * @return {@link #TRANSPORT_OK} if the transport was successful in shutting down the
514      *    current stream cleanly, or {@link #TRANSPORT_ERROR} to indicate a serious
515      *    transport-level failure.  If the transport reports an error here, the entire restore
516      *    operation will immediately be finished with no further attempts to restore app data.
517      */
abortFullRestore()518     public int abortFullRestore() {
519         return BackupTransport.TRANSPORT_OK;
520     }
521 
522     /**
523      * Bridge between the actual IBackupTransport implementation and the stable API.  If the
524      * binder interface needs to change, we use this layer to translate so that we can
525      * (if appropriate) decouple those framework-side changes from the BackupTransport
526      * implementations.
527      */
528     class TransportImpl extends IBackupTransport.Stub {
529 
530         @Override
name()531         public String name() throws RemoteException {
532             return BackupTransport.this.name();
533         }
534 
535         @Override
configurationIntent()536         public Intent configurationIntent() throws RemoteException {
537             return BackupTransport.this.configurationIntent();
538         }
539 
540         @Override
currentDestinationString()541         public String currentDestinationString() throws RemoteException {
542             return BackupTransport.this.currentDestinationString();
543         }
544 
545         @Override
dataManagementIntent()546         public Intent dataManagementIntent() {
547             return BackupTransport.this.dataManagementIntent();
548         }
549 
550         @Override
dataManagementLabel()551         public String dataManagementLabel() {
552             return BackupTransport.this.dataManagementLabel();
553         }
554 
555         @Override
transportDirName()556         public String transportDirName() throws RemoteException {
557             return BackupTransport.this.transportDirName();
558         }
559 
560         @Override
requestBackupTime()561         public long requestBackupTime() throws RemoteException {
562             return BackupTransport.this.requestBackupTime();
563         }
564 
565         @Override
initializeDevice()566         public int initializeDevice() throws RemoteException {
567             return BackupTransport.this.initializeDevice();
568         }
569 
570         @Override
performBackup(PackageInfo packageInfo, ParcelFileDescriptor inFd)571         public int performBackup(PackageInfo packageInfo, ParcelFileDescriptor inFd)
572                 throws RemoteException {
573             return BackupTransport.this.performBackup(packageInfo, inFd);
574         }
575 
576         @Override
clearBackupData(PackageInfo packageInfo)577         public int clearBackupData(PackageInfo packageInfo) throws RemoteException {
578             return BackupTransport.this.clearBackupData(packageInfo);
579         }
580 
581         @Override
finishBackup()582         public int finishBackup() throws RemoteException {
583             return BackupTransport.this.finishBackup();
584         }
585 
586         @Override
getAvailableRestoreSets()587         public RestoreSet[] getAvailableRestoreSets() throws RemoteException {
588             return BackupTransport.this.getAvailableRestoreSets();
589         }
590 
591         @Override
getCurrentRestoreSet()592         public long getCurrentRestoreSet() throws RemoteException {
593             return BackupTransport.this.getCurrentRestoreSet();
594         }
595 
596         @Override
startRestore(long token, PackageInfo[] packages)597         public int startRestore(long token, PackageInfo[] packages) throws RemoteException {
598             return BackupTransport.this.startRestore(token, packages);
599         }
600 
601         @Override
nextRestorePackage()602         public RestoreDescription nextRestorePackage() throws RemoteException {
603             return BackupTransport.this.nextRestorePackage();
604         }
605 
606         @Override
getRestoreData(ParcelFileDescriptor outFd)607         public int getRestoreData(ParcelFileDescriptor outFd) throws RemoteException {
608             return BackupTransport.this.getRestoreData(outFd);
609         }
610 
611         @Override
finishRestore()612         public void finishRestore() throws RemoteException {
613             BackupTransport.this.finishRestore();
614         }
615 
616         @Override
requestFullBackupTime()617         public long requestFullBackupTime() throws RemoteException {
618             return BackupTransport.this.requestFullBackupTime();
619         }
620 
621         @Override
performFullBackup(PackageInfo targetPackage, ParcelFileDescriptor socket)622         public int performFullBackup(PackageInfo targetPackage, ParcelFileDescriptor socket) throws RemoteException {
623             return BackupTransport.this.performFullBackup(targetPackage, socket);
624         }
625 
626         @Override
checkFullBackupSize(long size)627         public int checkFullBackupSize(long size) {
628             return BackupTransport.this.checkFullBackupSize(size);
629         }
630 
631         @Override
sendBackupData(int numBytes)632         public int sendBackupData(int numBytes) throws RemoteException {
633             return BackupTransport.this.sendBackupData(numBytes);
634         }
635 
636         @Override
cancelFullBackup()637         public void cancelFullBackup() throws RemoteException {
638             BackupTransport.this.cancelFullBackup();
639         }
640 
641         @Override
getNextFullRestoreDataChunk(ParcelFileDescriptor socket)642         public int getNextFullRestoreDataChunk(ParcelFileDescriptor socket) {
643             return BackupTransport.this.getNextFullRestoreDataChunk(socket);
644         }
645 
646         @Override
abortFullRestore()647         public int abortFullRestore() {
648             return BackupTransport.this.abortFullRestore();
649         }
650     }
651 }
652