Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ffa1d0d3 authored by Joël Stemmer's avatar Joël Stemmer Committed by Android (Google) Code Review
Browse files

Merge "Rename onMeasureFullBackup to onEstimateFullBackupBytes" into main

parents 31dd0cf5 1bdc48db
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -9282,8 +9282,8 @@ package android.app.backup {
    method public abstract void onBackup(android.os.ParcelFileDescriptor, android.app.backup.BackupDataOutput, android.os.ParcelFileDescriptor) throws java.io.IOException;
    method public void onCreate();
    method public void onDestroy();
    method @FlaggedApi("com.android.server.backup.enable_cross_platform_transfer") public long onEstimateFullBackupBytes(long, int) throws java.io.IOException;
    method public void onFullBackup(android.app.backup.FullBackupDataOutput) throws java.io.IOException;
    method @FlaggedApi("com.android.server.backup.enable_cross_platform_transfer") public long onMeasureFullBackup(long, int) throws java.io.IOException;
    method public void onQuotaExceeded(long, long);
    method public abstract void onRestore(android.app.backup.BackupDataInput, int, android.os.ParcelFileDescriptor) throws java.io.IOException;
    method public void onRestore(android.app.backup.BackupDataInput, long, android.os.ParcelFileDescriptor) throws java.io.IOException;
+4 −2
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.app.backup;

import android.annotation.BytesLong;
import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.NonNull;
@@ -652,7 +653,8 @@ public abstract class BackupAgent extends ContextWrapper {
     *     will fallback to using {@link #onFullBackup(FullBackupDataOutput)} to measure the size.
     */
    @FlaggedApi(Flags.FLAG_ENABLE_CROSS_PLATFORM_TRANSFER)
    public long onMeasureFullBackup(long quotaBytes, int transportFlags) throws IOException {
    @BytesLong
    public long onEstimateFullBackupBytes(long quotaBytes, int transportFlags) throws IOException {
        return -1;
    }

@@ -1419,7 +1421,7 @@ public abstract class BackupAgent extends ContextWrapper {
            try {
                if (Flags.enableCrossPlatformTransfer()) {
                    estimatedBackupSize =
                            BackupAgent.this.onMeasureFullBackup(quotaBytes, transportFlags);
                            BackupAgent.this.onEstimateFullBackupBytes(quotaBytes, transportFlags);
                    if (estimatedBackupSize < 0) {
                        BackupAgent.this.onFullBackup(measureOutput);
                    }
+1 −1
Original line number Diff line number Diff line
@@ -301,7 +301,7 @@ public class BackupAgentTest {
        }

        @Override
        public long onMeasureFullBackup(long quotaBytes, int transportFlags) {
        public long onEstimateFullBackupBytes(long quotaBytes, int transportFlags) {
            mOnMeasureFullBackupCalled = true;
            return mSize;
        }
+2 −2
Original line number Diff line number Diff line
@@ -77,8 +77,8 @@ public class ForwardingBackupAgent extends BackupAgent {
    }

    @Override
    public long onMeasureFullBackup(long quotaBytes, int transportFlags) throws IOException {
        return mBackupAgent.onMeasureFullBackup(quotaBytes, transportFlags);
    public long onEstimateFullBackupBytes(long quotaBytes, int transportFlags) throws IOException {
        return mBackupAgent.onEstimateFullBackupBytes(quotaBytes, transportFlags);
    }

    @Override