Merge "Add @IntDef for backup transport flags" into sc-dev

This commit is contained in:
Ruslan Tkhakokhov
2021-04-22 12:22:42 +00:00
committed by Android (Google) Code Review
2 changed files with 15 additions and 1 deletions

View File

@@ -16,6 +16,7 @@
package android.app.backup; package android.app.backup;
import android.annotation.IntDef;
import android.annotation.Nullable; import android.annotation.Nullable;
import android.app.IBackupAgent; import android.app.IBackupAgent;
import android.app.QueuedWork; import android.app.QueuedWork;
@@ -48,6 +49,8 @@ import org.xmlpull.v1.XmlPullParserException;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Collections; import java.util.Collections;
import java.util.HashSet; import java.util.HashSet;
import java.util.LinkedList; import java.util.LinkedList;
@@ -188,6 +191,15 @@ public abstract class BackupAgent extends ContextWrapper {
*/ */
public static final int FLAG_FAKE_CLIENT_SIDE_ENCRYPTION_ENABLED = 1 << 31; public static final int FLAG_FAKE_CLIENT_SIDE_ENCRYPTION_ENABLED = 1 << 31;
/** @hide */
@Retention(RetentionPolicy.SOURCE)
@IntDef(flag = true, value = {
FLAG_CLIENT_SIDE_ENCRYPTION_ENABLED,
FLAG_DEVICE_TO_DEVICE_TRANSFER,
FLAG_FAKE_CLIENT_SIDE_ENCRYPTION_ENABLED
})
public @interface BackupTransportFlags {}
Handler mHandler = null; Handler mHandler = null;
@Nullable private UserHandle mUser; @Nullable private UserHandle mUser;

View File

@@ -18,6 +18,7 @@ package android.app.backup;
import android.annotation.Nullable; import android.annotation.Nullable;
import android.annotation.SystemApi; import android.annotation.SystemApi;
import android.app.backup.BackupAgent.BackupTransportFlags;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
@@ -54,6 +55,7 @@ public class RestoreSet implements Parcelable {
* Properties of the {@link BackupTransport} transport that was used to obtain the data in * Properties of the {@link BackupTransport} transport that was used to obtain the data in
* this restore set. * this restore set.
*/ */
@BackupTransportFlags
public final int backupTransportFlags; public final int backupTransportFlags;
/** /**
@@ -87,7 +89,7 @@ public class RestoreSet implements Parcelable {
* flag values. * flag values.
*/ */
public RestoreSet(@Nullable String name, @Nullable String device, long token, public RestoreSet(@Nullable String name, @Nullable String device, long token,
int backupTransportFlags) { @BackupTransportFlags int backupTransportFlags) {
this.name = name; this.name = name;
this.device = device; this.device = device;
this.token = token; this.token = token;