1 /*
2  * Copyright (C) 2017 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 com.android.server.backup.fullbackup;
18 
19 import android.app.IBackupAgent;
20 import android.content.pm.PackageInfo;
21 
22 /**
23  * Callout from the engine to an interested participant that might need to communicate with the
24  * agent prior to asking it to move data.
25  */
26 public interface FullBackupPreflight {
27 
28     /**
29      * Perform the preflight operation necessary for the given package.
30      *
31      * @param pkg The name of the package being proposed for full-data backup
32      * @param agent Live BackupAgent binding to the target app's agent
33      * @return BackupTransport.TRANSPORT_OK to proceed with the backup operation, or one of the
34      * other BackupTransport.* error codes as appropriate
35      */
preflightFullBackup(PackageInfo pkg, IBackupAgent agent)36     int preflightFullBackup(PackageInfo pkg, IBackupAgent agent);
37 
getExpectedSizeOrErrorCode()38     long getExpectedSizeOrErrorCode();
39 }
40