IBackupManager.aidl revision 9171749700853305f3e6abbcdbd9e02f3a71d459
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     */
365cbbf5652a78902ac3382dc4a3583bc5b0351027Christopher Tate    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     */
425cbbf5652a78902ac3382dc4a3583bc5b0351027Christopher Tate    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     */
485cbbf5652a78902ac3382dc4a3583bc5b0351027Christopher Tate    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     */
605cbbf5652a78902ac3382dc4a3583bc5b0351027Christopher Tate    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     */
669171749700853305f3e6abbcdbd9e02f3a71d459Christopher Tate    String getCurrentTransport();
67043dadc7516d20c3b3ccbcb20c53aaeef076a237Christopher Tate
68043dadc7516d20c3b3ccbcb20c53aaeef076a237Christopher Tate    /**
699171749700853305f3e6abbcdbd9e02f3a71d459Christopher Tate     * Request a list of all available backup transports' names.  Callers must
709171749700853305f3e6abbcdbd9e02f3a71d459Christopher Tate     * hold the android.permission.BACKUP permission to use this method.
719171749700853305f3e6abbcdbd9e02f3a71d459Christopher Tate     */
729171749700853305f3e6abbcdbd9e02f3a71d459Christopher Tate    String[] listAllTransports();
739171749700853305f3e6abbcdbd9e02f3a71d459Christopher Tate
749171749700853305f3e6abbcdbd9e02f3a71d459Christopher Tate    /**
759171749700853305f3e6abbcdbd9e02f3a71d459Christopher Tate     * Specify the current backup transport.  Callers must hold the
76043dadc7516d20c3b3ccbcb20c53aaeef076a237Christopher Tate     * android.permission.BACKUP permission to use this method.
77043dadc7516d20c3b3ccbcb20c53aaeef076a237Christopher Tate     *
789171749700853305f3e6abbcdbd9e02f3a71d459Christopher Tate     * @param transport The name of the transport to select.  This should be one
79043dadc7516d20c3b3ccbcb20c53aaeef076a237Christopher Tate     * of {@link BackupManager.TRANSPORT_GOOGLE} or {@link BackupManager.TRANSPORT_ADB}.
809171749700853305f3e6abbcdbd9e02f3a71d459Christopher Tate     * @return The name of the previously selected transport.  If the given transport
819171749700853305f3e6abbcdbd9e02f3a71d459Christopher Tate     *   name is not one of the currently available transports, no change is made to
829171749700853305f3e6abbcdbd9e02f3a71d459Christopher Tate     *   the current transport setting and the method returns null.
83043dadc7516d20c3b3ccbcb20c53aaeef076a237Christopher Tate     */
849171749700853305f3e6abbcdbd9e02f3a71d459Christopher Tate    String selectBackupTransport(String transport);
858c850b792f2d371fd8a4aff146d9d757ee982539Christopher Tate
868c850b792f2d371fd8a4aff146d9d757ee982539Christopher Tate    /**
878c850b792f2d371fd8a4aff146d9d757ee982539Christopher Tate     * Begin a restore session with the given transport (which may differ from the
888c850b792f2d371fd8a4aff146d9d757ee982539Christopher Tate     * currently-active backup transport).
898c850b792f2d371fd8a4aff146d9d757ee982539Christopher Tate     *
909171749700853305f3e6abbcdbd9e02f3a71d459Christopher Tate     * @param transport The name of the transport to use for the restore operation.
918c850b792f2d371fd8a4aff146d9d757ee982539Christopher Tate     * @return An interface to the restore session, or null on error.
928c850b792f2d371fd8a4aff146d9d757ee982539Christopher Tate     */
939171749700853305f3e6abbcdbd9e02f3a71d459Christopher Tate    IRestoreSession beginRestoreSession(String transportID);
94487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate}
95