summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorChristopher Tate <ctate@google.com>2010-12-09 13:06:46 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-12-09 13:06:46 -0800
commita58fd15a5be03927f7ae211ee25ce165ec167681 (patch)
treec4a936ec74e12f2d9677456469867b4507a7fd75 /services
parent488a0d5ece8d68a2a49117e698ecaa6de4faf6b9 (diff)
parentf5e1c296370b45503a6c48bdb7da8b829bc0b906 (diff)
downloadframeworks_base-a58fd15a5be03927f7ae211ee25ce165ec167681.zip
frameworks_base-a58fd15a5be03927f7ae211ee25ce165ec167681.tar.gz
frameworks_base-a58fd15a5be03927f7ae211ee25ce165ec167681.tar.bz2
Merge "Add a couple of transport-descriptive methods to IBackupManager"
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/BackupManagerService.java49
1 files changed, 49 insertions, 0 deletions
diff --git a/services/java/com/android/server/BackupManagerService.java b/services/java/com/android/server/BackupManagerService.java
index 2651fd3..1617a4e 100644
--- a/services/java/com/android/server/BackupManagerService.java
+++ b/services/java/com/android/server/BackupManagerService.java
@@ -2344,6 +2344,55 @@ class BackupManagerService extends IBackupManager.Stub {
}
}
+ // Supply the configuration Intent for the given transport. If the name is not one
+ // of the available transports, or if the transport does not supply any configuration
+ // UI, the method returns null.
+ public Intent getConfigurationIntent(String transportName) {
+ mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP,
+ "getConfigurationIntent");
+
+ synchronized (mTransports) {
+ final IBackupTransport transport = mTransports.get(transportName);
+ if (transport != null) {
+ try {
+ final Intent intent = transport.configurationIntent();
+ if (DEBUG) Slog.d(TAG, "getConfigurationIntent() returning config intent "
+ + intent);
+ return intent;
+ } catch (RemoteException e) {
+ /* fall through to return null */
+ }
+ }
+ }
+
+ return null;
+ }
+
+ // Supply the configuration summary string for the given transport. If the name is
+ // not one of the available transports, or if the transport does not supply any
+ // summary / destination string, the method can return null.
+ //
+ // This string is used VERBATIM as the summary text of the relevant Settings item!
+ public String getDestinationString(String transportName) {
+ mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP,
+ "getConfigurationIntent");
+
+ synchronized (mTransports) {
+ final IBackupTransport transport = mTransports.get(transportName);
+ if (transport != null) {
+ try {
+ final String text = transport.currentDestinationString();
+ if (DEBUG) Slog.d(TAG, "getDestinationString() returning " + text);
+ return text;
+ } catch (RemoteException e) {
+ /* fall through to return null */
+ }
+ }
+ }
+
+ return null;
+ }
+
// Callback: a requested backup agent has been instantiated. This should only
// be called from the Activity Manager.
public void agentConnected(String packageName, IBinder agentBinder) {