1 /* 2 * Copyright (C) 2022 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.app.backup; 18 19 import android.annotation.IntDef; 20 21 import java.lang.annotation.Retention; 22 import java.lang.annotation.RetentionPolicy; 23 24 /** 25 * Annotations related to Android Backup&Restore. 26 * 27 * @hide 28 */ 29 public class BackupAnnotations { 30 /** @hide */ 31 @Retention(RetentionPolicy.SOURCE) 32 @IntDef({ 33 OperationType.UNKNOWN, 34 OperationType.BACKUP, 35 OperationType.RESTORE, 36 }) 37 public @interface OperationType { 38 int UNKNOWN = -1; 39 int BACKUP = 0; 40 int RESTORE = 1; 41 } 42 43 /** 44 * Denotes where the backup data is going (e.g. to the cloud or directly to the other device) 45 * during backup or where it is coming from during restore. 46 * 47 * @hide */ 48 @Retention(RetentionPolicy.SOURCE) 49 @IntDef({ 50 BackupDestination.CLOUD, 51 BackupDestination.DEVICE_TRANSFER, 52 BackupDestination.ADB_BACKUP 53 }) 54 public @interface BackupDestination { 55 // A cloud backup. 56 int CLOUD = 0; 57 // A device to device migration. 58 int DEVICE_TRANSFER = 1; 59 // An adb backup. 60 int ADB_BACKUP = 2; 61 } 62 } 63