IBackupManager.aidl revision ace7f094bf07bbd90cb998b9462e4f2d101a498c
1487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate/*
2487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * Copyright (C) 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
198c850b792f2d371fd8a4aff146d9d757ee982539Christopher Tateimport android.backup.IRestoreSession;
208c850b792f2d371fd8a4aff146d9d757ee982539Christopher Tate
21487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate/**
22487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * Direct interface to the Backup Manager Service that applications invoke on.  The only
23487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * operation currently needed is a simple notification that the app has made changes to
24487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * data it wishes to back up, so the system should run a backup pass.
25487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate *
26a8bf815c6153290b173f34b071dddb0a0034a115Christopher Tate * Apps will use the {@link android.backup.BackupManager} class rather than going through
27a8bf815c6153290b173f34b071dddb0a0034a115Christopher Tate * this Binder interface directly.
28a8bf815c6153290b173f34b071dddb0a0034a115Christopher Tate *
29a8bf815c6153290b173f34b071dddb0a0034a115Christopher Tate * {@hide}
30487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate */
31487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tateinterface IBackupManager {
32487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate    /**
33487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate     * Tell the system service that the caller has made changes to its
3446758123868d91e7b186aebb27c4c4988dede43eChristopher Tate     * data, and therefore needs to undergo an incremental backup pass.
35487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate     */
36a8bf815c6153290b173f34b071dddb0a0034a115Christopher Tate    oneway void dataChanged(String packageName);
3746758123868d91e7b186aebb27c4c4988dede43eChristopher Tate
3846758123868d91e7b186aebb27c4c4988dede43eChristopher Tate    /**
39181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     * Notifies the Backup Manager Service that an agent has become available.  This
40181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     * method is only invoked by the Activity Manager.
41181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     */
42181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate    oneway void agentConnected(String packageName, IBinder agent);
43181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate
44181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate    /**
45181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     * Notify the Backup Manager Service that an agent has unexpectedly gone away.
46181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     * This method is only invoked by the Activity Manager.
47181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     */
48181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate    oneway void agentDisconnected(String packageName);
49181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate
50181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate    /**
51ace7f094bf07bbd90cb998b9462e4f2d101a498cChristopher Tate     * Schedule an immediate backup attempt for all pending updates.  This is
52ace7f094bf07bbd90cb998b9462e4f2d101a498cChristopher Tate     * primarily intended for transports to use when they detect a suitable
53ace7f094bf07bbd90cb998b9462e4f2d101a498cChristopher Tate     * opportunity for doing a backup pass.  If there are no pending updates to
54ace7f094bf07bbd90cb998b9462e4f2d101a498cChristopher Tate     * be sent, no action will be taken.  Even if some updates are pending, the
55ace7f094bf07bbd90cb998b9462e4f2d101a498cChristopher Tate     * transport will still be asked to confirm via the usual requestBackupTime()
56ace7f094bf07bbd90cb998b9462e4f2d101a498cChristopher Tate     * method.
57ace7f094bf07bbd90cb998b9462e4f2d101a498cChristopher Tate     *
58ace7f094bf07bbd90cb998b9462e4f2d101a498cChristopher Tate     * <p>Callers must hold the android.permission.BACKUP permission to use this method.
59ace7f094bf07bbd90cb998b9462e4f2d101a498cChristopher Tate     */
60ace7f094bf07bbd90cb998b9462e4f2d101a498cChristopher Tate    oneway void backupNow();
61ace7f094bf07bbd90cb998b9462e4f2d101a498cChristopher Tate
62ace7f094bf07bbd90cb998b9462e4f2d101a498cChristopher Tate    /**
63ace7f094bf07bbd90cb998b9462e4f2d101a498cChristopher Tate     * Identify the currently selected transport.  Callers must hold the
64043dadc7516d20c3b3ccbcb20c53aaeef076a237Christopher Tate     * android.permission.BACKUP permission to use this method.
6546758123868d91e7b186aebb27c4c4988dede43eChristopher Tate     */
66ace7f094bf07bbd90cb998b9462e4f2d101a498cChristopher Tate    int getCurrentTransport();
67043dadc7516d20c3b3ccbcb20c53aaeef076a237Christopher Tate
68043dadc7516d20c3b3ccbcb20c53aaeef076a237Christopher Tate    /**
69043dadc7516d20c3b3ccbcb20c53aaeef076a237Christopher Tate     * Specify a default backup transport.  Callers must hold the
70043dadc7516d20c3b3ccbcb20c53aaeef076a237Christopher Tate     * android.permission.BACKUP permission to use this method.
71043dadc7516d20c3b3ccbcb20c53aaeef076a237Christopher Tate     *
72043dadc7516d20c3b3ccbcb20c53aaeef076a237Christopher Tate     * @param transportID The ID of the transport to select.  This should be one
73043dadc7516d20c3b3ccbcb20c53aaeef076a237Christopher Tate     * of {@link BackupManager.TRANSPORT_GOOGLE} or {@link BackupManager.TRANSPORT_ADB}.
74043dadc7516d20c3b3ccbcb20c53aaeef076a237Christopher Tate     * @return The ID of the previously selected transport.
75043dadc7516d20c3b3ccbcb20c53aaeef076a237Christopher Tate     */
76043dadc7516d20c3b3ccbcb20c53aaeef076a237Christopher Tate    int selectBackupTransport(int transportID);
778c850b792f2d371fd8a4aff146d9d757ee982539Christopher Tate
788c850b792f2d371fd8a4aff146d9d757ee982539Christopher Tate    /**
798c850b792f2d371fd8a4aff146d9d757ee982539Christopher Tate     * Begin a restore session with the given transport (which may differ from the
808c850b792f2d371fd8a4aff146d9d757ee982539Christopher Tate     * currently-active backup transport).
818c850b792f2d371fd8a4aff146d9d757ee982539Christopher Tate     *
828c850b792f2d371fd8a4aff146d9d757ee982539Christopher Tate     * @return An interface to the restore session, or null on error.
838c850b792f2d371fd8a4aff146d9d757ee982539Christopher Tate     */
848c850b792f2d371fd8a4aff146d9d757ee982539Christopher Tate    IRestoreSession beginRestoreSession(int transportID);
85487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate}
86