1package android.app.backup;
2
3import 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 */
10public 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 */
16    public FullBackupDataOutput() {
17        mData = null;
18        mSize = 0;
19    }
20
21    /** @hide */
22    public FullBackupDataOutput(ParcelFileDescriptor fd) {
23        mData = new BackupDataOutput(fd.getFileDescriptor());
24    }
25
26    /** @hide */
27    public BackupDataOutput getData() { return mData; }
28
29    /** @hide - used for measurement pass */
30    public void addSize(long size) {
31        if (size > 0) {
32            mSize += size;
33        }
34    }
35
36    /** @hide - used for measurement pass */
37    public long getSize() { return mSize; }
38}
39