• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package android.app.backup;
2 
3 import android.os.ParcelFileDescriptor;
4 
5 /**
6  * Provides the interface through which a {@link BackupAgent} writes entire files
7  * to a full backup data set, via its {@link BackupAgent#onFullBackup(FullBackupDataOutput)}
8  * method.
9  */
10 public class FullBackupDataOutput {
11     // Currently a name-scoping shim around BackupDataOutput
12     private final BackupDataOutput mData;
13     private long mSize;
14 
15     /** @hide - used only in measure operation */
FullBackupDataOutput()16     public FullBackupDataOutput() {
17         mData = null;
18         mSize = 0;
19     }
20 
21     /** @hide */
FullBackupDataOutput(ParcelFileDescriptor fd)22     public FullBackupDataOutput(ParcelFileDescriptor fd) {
23         mData = new BackupDataOutput(fd.getFileDescriptor());
24     }
25 
26     /** @hide */
getData()27     public BackupDataOutput getData() { return mData; }
28 
29     /** @hide - used for measurement pass */
addSize(long size)30     public void addSize(long size) {
31         if (size > 0) {
32             mSize += size;
33         }
34     }
35 
36     /** @hide - used for measurement pass */
getSize()37     public long getSize() { return mSize; }
38 }
39