Add `onMeasureFullBackup` method to `BackupAgent`
When backing up, a preflight check is performed that checks the size of the backup against the backup quota. By default, the backup agent measures the size of a backup by performing a full backup and discarding the backed up data. This means for a normal backup session, the `BackupAgent#onFullBackup` is called twice. For most backup agents this is fine, as they won't have much data to back up. We want to give apps that back up a lot of data (for example, during D2D where the backup quota is multiple gigabytes) the possibility to provide their own implementation of measuring the backup size so they can provide a more efficient implementation if needed. Bug: 403956528 Test: atest BackupAgentTest.java Test: atest MeasureFullBackupTest.java (cts test added in same topic) Flag: com.android.server.backup.enable_cross_platform_transfer Change-Id: If6a869e772d433acc770f47f4aa05f54c54d3c0e
Loading
Please register or sign in to comment