IBackupManager.aidl revision 75a99709accef8cf221fd436d646727e7c8dd1f1
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
174528186e0d65fc68ef0dd1941aa2ac8aefcd55a3Christopher Tatepackage android.app.backup;
18487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate
194a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tateimport android.app.backup.IFullBackupRestoreObserver;
204528186e0d65fc68ef0dd1941aa2ac8aefcd55a3Christopher Tateimport android.app.backup.IRestoreSession;
214a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tateimport android.os.ParcelFileDescriptor;
22f5e1c296370b45503a6c48bdb7da8b829bc0b906Christopher Tateimport android.content.Intent;
238c850b792f2d371fd8a4aff146d9d757ee982539Christopher Tate
24487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate/**
25487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * Direct interface to the Backup Manager Service that applications invoke on.  The only
26487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * operation currently needed is a simple notification that the app has made changes to
27487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate * data it wishes to back up, so the system should run a backup pass.
28487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate *
294528186e0d65fc68ef0dd1941aa2ac8aefcd55a3Christopher Tate * Apps will use the {@link android.app.backup.BackupManager} class rather than going through
30a8bf815c6153290b173f34b071dddb0a0034a115Christopher Tate * this Binder interface directly.
31a8bf815c6153290b173f34b071dddb0a0034a115Christopher Tate *
32a8bf815c6153290b173f34b071dddb0a0034a115Christopher Tate * {@hide}
33487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate */
34487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tateinterface IBackupManager {
35487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate    /**
36487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate     * Tell the system service that the caller has made changes to its
3746758123868d91e7b186aebb27c4c4988dede43eChristopher Tate     * data, and therefore needs to undergo an incremental backup pass.
38ee0e78af5af3bf23dd928fe5e0ebeb39157eaf66Christopher Tate     *
39ee0e78af5af3bf23dd928fe5e0ebeb39157eaf66Christopher Tate     * Any application can invoke this method for its own package, but
40ee0e78af5af3bf23dd928fe5e0ebeb39157eaf66Christopher Tate     * only callers who hold the android.permission.BACKUP permission
41ee0e78af5af3bf23dd928fe5e0ebeb39157eaf66Christopher Tate     * may invoke it for arbitrary packages.
42487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate     */
435cbbf5652a78902ac3382dc4a3583bc5b0351027Christopher Tate    void dataChanged(String packageName);
44ee0e78af5af3bf23dd928fe5e0ebeb39157eaf66Christopher Tate
45ee0e78af5af3bf23dd928fe5e0ebeb39157eaf66Christopher Tate    /**
46ee0e78af5af3bf23dd928fe5e0ebeb39157eaf66Christopher Tate     * Erase all backed-up data for the given package from the storage
47ee0e78af5af3bf23dd928fe5e0ebeb39157eaf66Christopher Tate     * destination.
48ee0e78af5af3bf23dd928fe5e0ebeb39157eaf66Christopher Tate     *
49ee0e78af5af3bf23dd928fe5e0ebeb39157eaf66Christopher Tate     * Any application can invoke this method for its own package, but
50ee0e78af5af3bf23dd928fe5e0ebeb39157eaf66Christopher Tate     * only callers who hold the android.permission.BACKUP permission
51ee0e78af5af3bf23dd928fe5e0ebeb39157eaf66Christopher Tate     * may invoke it for arbitrary packages.
52ee0e78af5af3bf23dd928fe5e0ebeb39157eaf66Christopher Tate     */
53ee0e78af5af3bf23dd928fe5e0ebeb39157eaf66Christopher Tate    void clearBackupData(String packageName);
5446758123868d91e7b186aebb27c4c4988dede43eChristopher Tate
5546758123868d91e7b186aebb27c4c4988dede43eChristopher Tate    /**
56181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     * Notifies the Backup Manager Service that an agent has become available.  This
57181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     * method is only invoked by the Activity Manager.
58181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     */
595cbbf5652a78902ac3382dc4a3583bc5b0351027Christopher Tate    void agentConnected(String packageName, IBinder agent);
60181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate
61181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate    /**
62181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     * Notify the Backup Manager Service that an agent has unexpectedly gone away.
63181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     * This method is only invoked by the Activity Manager.
64181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate     */
655cbbf5652a78902ac3382dc4a3583bc5b0351027Christopher Tate    void agentDisconnected(String packageName);
66181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate
67181fafaf48208978b8ba2022683ffa78aaeddde1Christopher Tate    /**
681bb6906c7a903ee6427c8ff37bdc5896c386ff73Christopher Tate     * Notify the Backup Manager Service that an application being installed will
691bb6906c7a903ee6427c8ff37bdc5896c386ff73Christopher Tate     * need a data-restore pass.  This method is only invoked by the Package Manager.
701bb6906c7a903ee6427c8ff37bdc5896c386ff73Christopher Tate     */
711bb6906c7a903ee6427c8ff37bdc5896c386ff73Christopher Tate    void restoreAtInstall(String packageName, int token);
721bb6906c7a903ee6427c8ff37bdc5896c386ff73Christopher Tate
731bb6906c7a903ee6427c8ff37bdc5896c386ff73Christopher Tate    /**
746ef58a1509b9d3348a33ca5686917796c2759aa5Christopher Tate     * Enable/disable the backup service entirely.  When disabled, no backup
756ef58a1509b9d3348a33ca5686917796c2759aa5Christopher Tate     * or restore operations will take place.  Data-changed notifications will
766ef58a1509b9d3348a33ca5686917796c2759aa5Christopher Tate     * still be observed and collected, however, so that changes made while the
776ef58a1509b9d3348a33ca5686917796c2759aa5Christopher Tate     * mechanism was disabled will still be backed up properly if it is enabled
786ef58a1509b9d3348a33ca5686917796c2759aa5Christopher Tate     * at some point in the future.
796ef58a1509b9d3348a33ca5686917796c2759aa5Christopher Tate     *
806ef58a1509b9d3348a33ca5686917796c2759aa5Christopher Tate     * <p>Callers must hold the android.permission.BACKUP permission to use this method.
816ef58a1509b9d3348a33ca5686917796c2759aa5Christopher Tate     */
826ef58a1509b9d3348a33ca5686917796c2759aa5Christopher Tate    void setBackupEnabled(boolean isEnabled);
836ef58a1509b9d3348a33ca5686917796c2759aa5Christopher Tate
846ef58a1509b9d3348a33ca5686917796c2759aa5Christopher Tate    /**
85cce9da5dc3d515f98c260af41a03e61e57b4e7a6Christopher Tate     * Enable/disable automatic restore of application data at install time.  When
86cce9da5dc3d515f98c260af41a03e61e57b4e7a6Christopher Tate     * enabled, installation of any package will involve the Backup Manager.  If data
87cce9da5dc3d515f98c260af41a03e61e57b4e7a6Christopher Tate     * exists for the newly-installed package, either from the device's current [enabled]
88cce9da5dc3d515f98c260af41a03e61e57b4e7a6Christopher Tate     * backup dataset or from the restore set used in the last wholesale restore operation,
89cce9da5dc3d515f98c260af41a03e61e57b4e7a6Christopher Tate     * that data will be supplied to the new package's restore agent before the package
90cce9da5dc3d515f98c260af41a03e61e57b4e7a6Christopher Tate     * is made generally available for launch.
91cce9da5dc3d515f98c260af41a03e61e57b4e7a6Christopher Tate     *
92cce9da5dc3d515f98c260af41a03e61e57b4e7a6Christopher Tate     * <p>Callers must hold  the android.permission.BACKUP permission to use this method.
93cce9da5dc3d515f98c260af41a03e61e57b4e7a6Christopher Tate     *
94cce9da5dc3d515f98c260af41a03e61e57b4e7a6Christopher Tate     * @param doAutoRestore When true, enables the automatic app-data restore facility.  When
95cce9da5dc3d515f98c260af41a03e61e57b4e7a6Christopher Tate     *   false, this facility will be disabled.
96cce9da5dc3d515f98c260af41a03e61e57b4e7a6Christopher Tate     */
97cce9da5dc3d515f98c260af41a03e61e57b4e7a6Christopher Tate    void setAutoRestore(boolean doAutoRestore);
98cce9da5dc3d515f98c260af41a03e61e57b4e7a6Christopher Tate
99cce9da5dc3d515f98c260af41a03e61e57b4e7a6Christopher Tate    /**
1008031a3df2fd0c38d85eeae39c1ea2c83e813f4ffChristopher Tate     * Indicate that any necessary one-time provisioning has occurred.
1018031a3df2fd0c38d85eeae39c1ea2c83e813f4ffChristopher Tate     *
1028031a3df2fd0c38d85eeae39c1ea2c83e813f4ffChristopher Tate     * <p>Callers must hold the android.permission.BACKUP permission to use this method.
1038031a3df2fd0c38d85eeae39c1ea2c83e813f4ffChristopher Tate     */
1048031a3df2fd0c38d85eeae39c1ea2c83e813f4ffChristopher Tate    void setBackupProvisioned(boolean isProvisioned);
1058031a3df2fd0c38d85eeae39c1ea2c83e813f4ffChristopher Tate
1068031a3df2fd0c38d85eeae39c1ea2c83e813f4ffChristopher Tate    /**
1076ef58a1509b9d3348a33ca5686917796c2759aa5Christopher Tate     * Report whether the backup mechanism is currently enabled.
1086ef58a1509b9d3348a33ca5686917796c2759aa5Christopher Tate     *
1096ef58a1509b9d3348a33ca5686917796c2759aa5Christopher Tate     * <p>Callers must hold the android.permission.BACKUP permission to use this method.
1106ef58a1509b9d3348a33ca5686917796c2759aa5Christopher Tate     */
1116ef58a1509b9d3348a33ca5686917796c2759aa5Christopher Tate    boolean isBackupEnabled();
1126ef58a1509b9d3348a33ca5686917796c2759aa5Christopher Tate
1136ef58a1509b9d3348a33ca5686917796c2759aa5Christopher Tate    /**
114ace7f094bf07bbd90cb998b9462e4f2d101a498cChristopher Tate     * Schedule an immediate backup attempt for all pending updates.  This is
115ace7f094bf07bbd90cb998b9462e4f2d101a498cChristopher Tate     * primarily intended for transports to use when they detect a suitable
116ace7f094bf07bbd90cb998b9462e4f2d101a498cChristopher Tate     * opportunity for doing a backup pass.  If there are no pending updates to
117ace7f094bf07bbd90cb998b9462e4f2d101a498cChristopher Tate     * be sent, no action will be taken.  Even if some updates are pending, the
118ace7f094bf07bbd90cb998b9462e4f2d101a498cChristopher Tate     * transport will still be asked to confirm via the usual requestBackupTime()
119ace7f094bf07bbd90cb998b9462e4f2d101a498cChristopher Tate     * method.
120ace7f094bf07bbd90cb998b9462e4f2d101a498cChristopher Tate     *
121ace7f094bf07bbd90cb998b9462e4f2d101a498cChristopher Tate     * <p>Callers must hold the android.permission.BACKUP permission to use this method.
122ace7f094bf07bbd90cb998b9462e4f2d101a498cChristopher Tate     */
1235cbbf5652a78902ac3382dc4a3583bc5b0351027Christopher Tate    void backupNow();
124ace7f094bf07bbd90cb998b9462e4f2d101a498cChristopher Tate
125ace7f094bf07bbd90cb998b9462e4f2d101a498cChristopher Tate    /**
1264a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate     * Write a full backup of the given package to the supplied file descriptor.
1274a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate     * The fd may be a socket or other non-seekable destination.  If no package names
1284a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate     * are supplied, then every application on the device will be backed up to the output.
1294a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate     *
1304a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate     * <p>This method is <i>synchronous</i> -- it does not return until the backup has
1314a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate     * completed.
1324a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate     *
1334a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate     * <p>Callers must hold the android.permission.BACKUP permission to use this method.
1344a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate     *
1354a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate     * @param fd The file descriptor to which a 'tar' file stream is to be written
1364a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate     * @param includeApks If <code>true</code>, the resulting tar stream will include the
1374a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate     *     application .apk files themselves as well as their data.
1384a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate     * @param includeShared If <code>true</code>, the resulting tar stream will include
1394a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate     *     the contents of the device's shared storage (SD card or equivalent).
1404a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate     * @param allApps If <code>true</code>, the resulting tar stream will include all
1414a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate     *     installed applications' data, not just those named in the <code>packageNames</code>
1424a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate     *     parameter.
1434a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate     * @param packageNames The package names of the apps whose data (and optionally .apk files)
1444a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate     *     are to be backed up.  The <code>allApps</code> parameter supersedes this.
1454a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate     */
1464a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate    void fullBackup(in ParcelFileDescriptor fd, boolean includeApks, boolean includeShared,
1474a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate            boolean allApps, in String[] packageNames);
1484a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate
1494a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate    /**
15075a99709accef8cf221fd436d646727e7c8dd1f1Christopher Tate     * Restore device content from the data stream passed through the given socket.  The
15175a99709accef8cf221fd436d646727e7c8dd1f1Christopher Tate     * data stream must be in the format emitted by fullBackup().
15275a99709accef8cf221fd436d646727e7c8dd1f1Christopher Tate     *
15375a99709accef8cf221fd436d646727e7c8dd1f1Christopher Tate     * <p>Callers must hold the android.permission.BACKUP permission to use this method.
15475a99709accef8cf221fd436d646727e7c8dd1f1Christopher Tate     */
15575a99709accef8cf221fd436d646727e7c8dd1f1Christopher Tate    void fullRestore(in ParcelFileDescriptor fd);
15675a99709accef8cf221fd436d646727e7c8dd1f1Christopher Tate
15775a99709accef8cf221fd436d646727e7c8dd1f1Christopher Tate    /**
1584a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate     * Confirm that the requested full backup/restore operation can proceed.  The system will
1594a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate     * not actually perform the operation described to fullBackup() / fullRestore() unless the
1604a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate     * UI calls back into the Backup Manager to confirm, passing the correct token.  At
1614a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate     * the same time, the UI supplies a callback Binder for progress notifications during
1624a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate     * the operation.
1634a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate     *
1644a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate     * <p>Callers must hold the android.permission.BACKUP permission to use this method.
1654a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate     */
1664a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate    void acknowledgeFullBackupOrRestore(int token, boolean allow,
1674a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate            IFullBackupRestoreObserver observer);
1684a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate
1694a627c71ff53a4fca1f961f4b1dcc0461df18a06Christopher Tate    /**
170ace7f094bf07bbd90cb998b9462e4f2d101a498cChristopher Tate     * Identify the currently selected transport.  Callers must hold the
171043dadc7516d20c3b3ccbcb20c53aaeef076a237Christopher Tate     * android.permission.BACKUP permission to use this method.
17246758123868d91e7b186aebb27c4c4988dede43eChristopher Tate     */
1739171749700853305f3e6abbcdbd9e02f3a71d459Christopher Tate    String getCurrentTransport();
174043dadc7516d20c3b3ccbcb20c53aaeef076a237Christopher Tate
175043dadc7516d20c3b3ccbcb20c53aaeef076a237Christopher Tate    /**
1769171749700853305f3e6abbcdbd9e02f3a71d459Christopher Tate     * Request a list of all available backup transports' names.  Callers must
1779171749700853305f3e6abbcdbd9e02f3a71d459Christopher Tate     * hold the android.permission.BACKUP permission to use this method.
1789171749700853305f3e6abbcdbd9e02f3a71d459Christopher Tate     */
1799171749700853305f3e6abbcdbd9e02f3a71d459Christopher Tate    String[] listAllTransports();
1809171749700853305f3e6abbcdbd9e02f3a71d459Christopher Tate
1819171749700853305f3e6abbcdbd9e02f3a71d459Christopher Tate    /**
1829171749700853305f3e6abbcdbd9e02f3a71d459Christopher Tate     * Specify the current backup transport.  Callers must hold the
183043dadc7516d20c3b3ccbcb20c53aaeef076a237Christopher Tate     * android.permission.BACKUP permission to use this method.
184043dadc7516d20c3b3ccbcb20c53aaeef076a237Christopher Tate     *
1859171749700853305f3e6abbcdbd9e02f3a71d459Christopher Tate     * @param transport The name of the transport to select.  This should be one
186043dadc7516d20c3b3ccbcb20c53aaeef076a237Christopher Tate     * of {@link BackupManager.TRANSPORT_GOOGLE} or {@link BackupManager.TRANSPORT_ADB}.
1879171749700853305f3e6abbcdbd9e02f3a71d459Christopher Tate     * @return The name of the previously selected transport.  If the given transport
1889171749700853305f3e6abbcdbd9e02f3a71d459Christopher Tate     *   name is not one of the currently available transports, no change is made to
1899171749700853305f3e6abbcdbd9e02f3a71d459Christopher Tate     *   the current transport setting and the method returns null.
190043dadc7516d20c3b3ccbcb20c53aaeef076a237Christopher Tate     */
1919171749700853305f3e6abbcdbd9e02f3a71d459Christopher Tate    String selectBackupTransport(String transport);
1928c850b792f2d371fd8a4aff146d9d757ee982539Christopher Tate
1938c850b792f2d371fd8a4aff146d9d757ee982539Christopher Tate    /**
194f5e1c296370b45503a6c48bdb7da8b829bc0b906Christopher Tate     * Get the configuration Intent, if any, from the given transport.  Callers must
195f5e1c296370b45503a6c48bdb7da8b829bc0b906Christopher Tate     * hold the android.permission.BACKUP permission in order to use this method.
196f5e1c296370b45503a6c48bdb7da8b829bc0b906Christopher Tate     *
197f5e1c296370b45503a6c48bdb7da8b829bc0b906Christopher Tate     * @param transport The name of the transport to query.
198f5e1c296370b45503a6c48bdb7da8b829bc0b906Christopher Tate     * @return An Intent to use with Activity#startActivity() to bring up the configuration
199f5e1c296370b45503a6c48bdb7da8b829bc0b906Christopher Tate     *   UI supplied by the transport.  If the transport has no configuration UI, it should
200f5e1c296370b45503a6c48bdb7da8b829bc0b906Christopher Tate     *   return {@code null} here.
201f5e1c296370b45503a6c48bdb7da8b829bc0b906Christopher Tate     */
202f5e1c296370b45503a6c48bdb7da8b829bc0b906Christopher Tate    Intent getConfigurationIntent(String transport);
203f5e1c296370b45503a6c48bdb7da8b829bc0b906Christopher Tate
204f5e1c296370b45503a6c48bdb7da8b829bc0b906Christopher Tate    /**
205f5e1c296370b45503a6c48bdb7da8b829bc0b906Christopher Tate     * Get the destination string supplied by the given transport.  Callers must
206f5e1c296370b45503a6c48bdb7da8b829bc0b906Christopher Tate     * hold the android.permission.BACKUP permission in order to use this method.
207f5e1c296370b45503a6c48bdb7da8b829bc0b906Christopher Tate     *
208f5e1c296370b45503a6c48bdb7da8b829bc0b906Christopher Tate     * @param transport The name of the transport to query.
209f5e1c296370b45503a6c48bdb7da8b829bc0b906Christopher Tate     * @return A string describing the current backup destination.  This string is used
210f5e1c296370b45503a6c48bdb7da8b829bc0b906Christopher Tate     *   verbatim by the Settings UI as the summary text of the "configure..." item.
211f5e1c296370b45503a6c48bdb7da8b829bc0b906Christopher Tate     */
212f5e1c296370b45503a6c48bdb7da8b829bc0b906Christopher Tate    String getDestinationString(String transport);
213f5e1c296370b45503a6c48bdb7da8b829bc0b906Christopher Tate
214f5e1c296370b45503a6c48bdb7da8b829bc0b906Christopher Tate    /**
21544ab8453e1c4c46790f792a46d026fa1017d8cfeChris Tate     * Begin a restore session.  Either or both of packageName and transportID
21644ab8453e1c4c46790f792a46d026fa1017d8cfeChris Tate     * may be null.  If packageName is non-null, then only the given package will be
21744ab8453e1c4c46790f792a46d026fa1017d8cfeChris Tate     * considered for restore.  If transportID is null, then the restore will use
21844ab8453e1c4c46790f792a46d026fa1017d8cfeChris Tate     * the current active transport.
21944ab8453e1c4c46790f792a46d026fa1017d8cfeChris Tate     * <p>
22044ab8453e1c4c46790f792a46d026fa1017d8cfeChris Tate     * This method requires the android.permission.BACKUP permission <i>except</i>
22144ab8453e1c4c46790f792a46d026fa1017d8cfeChris Tate     * when transportID is null and packageName is the name of the caller's own
22244ab8453e1c4c46790f792a46d026fa1017d8cfeChris Tate     * package.  In that case, the restore session returned is suitable for supporting
22344ab8453e1c4c46790f792a46d026fa1017d8cfeChris Tate     * the BackupManager.requestRestore() functionality via RestoreSession.restorePackage()
22444ab8453e1c4c46790f792a46d026fa1017d8cfeChris Tate     * without requiring the app to hold any special permission.
2258c850b792f2d371fd8a4aff146d9d757ee982539Christopher Tate     *
22644ab8453e1c4c46790f792a46d026fa1017d8cfeChris Tate     * @param packageName The name of the single package for which a restore will
22744ab8453e1c4c46790f792a46d026fa1017d8cfeChris Tate     *        be requested.  May be null, in which case all packages in the restore
22844ab8453e1c4c46790f792a46d026fa1017d8cfeChris Tate     *        set can be restored.
22944ab8453e1c4c46790f792a46d026fa1017d8cfeChris Tate     * @param transportID The name of the transport to use for the restore operation.
23044ab8453e1c4c46790f792a46d026fa1017d8cfeChris Tate     *        May be null, in which case the current active transport is used.
2318c850b792f2d371fd8a4aff146d9d757ee982539Christopher Tate     * @return An interface to the restore session, or null on error.
2328c850b792f2d371fd8a4aff146d9d757ee982539Christopher Tate     */
23344ab8453e1c4c46790f792a46d026fa1017d8cfeChris Tate    IRestoreSession beginRestoreSession(String packageName, String transportID);
23444a2790374bf27116cbd91060d4f096ca5999709Christopher Tate
23544a2790374bf27116cbd91060d4f096ca5999709Christopher Tate    /**
23644a2790374bf27116cbd91060d4f096ca5999709Christopher Tate     * Notify the backup manager that a BackupAgent has completed the operation
23744a2790374bf27116cbd91060d4f096ca5999709Christopher Tate     * corresponding to the given token.
23844a2790374bf27116cbd91060d4f096ca5999709Christopher Tate     *
23944a2790374bf27116cbd91060d4f096ca5999709Christopher Tate     * @param token The transaction token passed to a BackupAgent's doBackup() or
24044a2790374bf27116cbd91060d4f096ca5999709Christopher Tate     *        doRestore() method.
24144a2790374bf27116cbd91060d4f096ca5999709Christopher Tate     * {@hide}
24244a2790374bf27116cbd91060d4f096ca5999709Christopher Tate     */
24344a2790374bf27116cbd91060d4f096ca5999709Christopher Tate    void opComplete(int token);
244487529a70cd1479ae8d6bbfb356be7e72542c185Christopher Tate}
245