IBackupAgent.aidl revision 22b8787ed4be8d4b7ed5d54802f9913fedb41425
1487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate/* 2487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * Copyright 2009, The Android Open Source Project 3487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * 4487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * Licensed under the Apache License, Version 2.0 (the "License"); 5487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * you may not use this file except in compliance with the License. 6487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * You may obtain a copy of the License at 7487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * 8487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * http://www.apache.org/licenses/LICENSE-2.0 9487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * 10487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * Unless required by applicable law or agreed to in writing, software 11487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * distributed under the License is distributed on an "AS IS" BASIS, 12487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * See the License for the specific language governing permissions and 14487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * limitations under the License. 15487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate */ 16487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate 17487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tatepackage android.backup; 18487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate 1922b8787ed4be8d4b7ed5d54802f9913fedb41425Christopher Tateimport android.os.ParcelFileDescriptor; 2022b8787ed4be8d4b7ed5d54802f9913fedb41425Christopher Tate 21487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate/** 22487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * Interface presented by applications being asked to participate in the 23487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * backup & restore mechanism. End user code does not typically implement 24487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * this interface; they subclass BackupService instead. 25487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * 26487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * {@hide} 2722b8787ed4be8d4b7ed5d54802f9913fedb41425Christopher Tate */ 28487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tateinterface IBackupService { 29487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate /** 30487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * Request that the app perform an incremental backup. 31487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * 3222b8787ed4be8d4b7ed5d54802f9913fedb41425Christopher Tate * @param oldState Read-only file containing the description blob of the 33487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * app's data state as of the last backup operation's completion. 3422b8787ed4be8d4b7ed5d54802f9913fedb41425Christopher Tate * This file is empty or invalid when a full backup is being 3522b8787ed4be8d4b7ed5d54802f9913fedb41425Christopher Tate * requested. 36487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * 3722b8787ed4be8d4b7ed5d54802f9913fedb41425Christopher Tate * @param data Read-write file, empty when onBackup() is called, that 38487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * is the data destination for this backup pass's incrementals. 39487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * 4022b8787ed4be8d4b7ed5d54802f9913fedb41425Christopher Tate * @param newState Read-write file, empty when onBackup() is called, 41487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * where the new state blob is to be recorded. 42487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate */ 4322b8787ed4be8d4b7ed5d54802f9913fedb41425Christopher Tate void doBackup(in ParcelFileDescriptor oldState, 4422b8787ed4be8d4b7ed5d54802f9913fedb41425Christopher Tate in ParcelFileDescriptor data, 4522b8787ed4be8d4b7ed5d54802f9913fedb41425Christopher Tate in ParcelFileDescriptor newState); 46487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate 47487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate /** 48487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * Restore an entire data snapshot to the application. 49487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * 5022b8787ed4be8d4b7ed5d54802f9913fedb41425Christopher Tate * @param data Read-only file containing the full data snapshot of the 51487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * app's backup. This is to be a <i>replacement</i> of the app's 52487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * current data, not to be merged into it. 53487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * 5422b8787ed4be8d4b7ed5d54802f9913fedb41425Christopher Tate * @param newState Read-write file, empty when onRestore() is called, 55487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * that is to be written with the state description that holds after 56487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * the restore has been completed. 57487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate */ 5822b8787ed4be8d4b7ed5d54802f9913fedb41425Christopher Tate void doRestore(in ParcelFileDescriptor data, in ParcelFileDescriptor newState); 59487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate} 60