diff options
author | Christopher Tate <ctate@google.com> | 2014-07-27 20:21:55 -0700 |
---|---|---|
committer | Christopher Tate <ctate@android.com> | 2014-07-28 21:33:15 +0000 |
commit | 9679410db578e179c7559e7a52bb21c8082e9631 (patch) | |
tree | dfd7a9eec20b3838b21c8da4664f275152092676 /core/java/android/app/backup | |
parent | 701d6ff12f36bf5e9de0dafdaced06744fd411eb (diff) | |
download | frameworks_base-9679410db578e179c7559e7a52bb21c8082e9631.zip frameworks_base-9679410db578e179c7559e7a52bb21c8082e9631.tar.gz frameworks_base-9679410db578e179c7559e7a52bb21c8082e9631.tar.bz2 |
Add data-management intent + label to BackupTransport API
Bug 16346320
Change-Id: Id9e855a1d3cebbf801c27a21e1edc3ffcccfd2e9
Diffstat (limited to 'core/java/android/app/backup')
-rw-r--r-- | core/java/android/app/backup/BackupTransport.java | 53 |
1 files changed, 50 insertions, 3 deletions
diff --git a/core/java/android/app/backup/BackupTransport.java b/core/java/android/app/backup/BackupTransport.java index 28108a0..446c03e 100644 --- a/core/java/android/app/backup/BackupTransport.java +++ b/core/java/android/app/backup/BackupTransport.java @@ -72,11 +72,11 @@ public class BackupTransport { * may offer a UI for allowing the user to supply login credentials for the * transport's off-device backend. * - * If the transport does not supply any user-facing configuration UI, it should - * return null from this method. + * <p>If the transport does not supply any user-facing configuration UI, it should + * return {@code null} from this method. * * @return An Intent that can be passed to Context.startActivity() in order to - * launch the transport's configuration UI. This method will return null + * launch the transport's configuration UI. This method will return {@code null} * if the transport does not offer any user-facing configuration UI. */ public Intent configurationIntent() { @@ -98,6 +98,43 @@ public class BackupTransport { } /** + * Ask the transport for an Intent that can be used to launch a more detailed + * secondary data management activity. For example, the configuration intent might + * be one for allowing the user to select which account they wish to associate + * their backups with, and the management intent might be one which presents a + * UI for managing the data on the backend. + * + * <p>In the Settings UI, the configuration intent will typically be invoked + * when the user taps on the preferences item labeled with the current + * destination string, and the management intent will be placed in an overflow + * menu labelled with the management label string. + * + * <p>If the transport does not supply any user-facing data management + * UI, then it should return {@code null} from this method. + * + * @return An intent that can be passed to Context.startActivity() in order to + * launch the transport's data-management UI. This method will return + * {@code null} if the transport does not offer any user-facing data + * management UI. + */ + public Intent dataManagementIntent() { + return null; + } + + /** + * On demand, supply a short string that can be shown to the user as the label + * on an overflow menu item used to invoked the data management UI. + * + * @return A string to be used as the label for the transport's data management + * affordance. If the transport supplies a data management intent, this + * method must not return {@code null}. + */ + public String dataManagementLabel() { + throw new UnsupportedOperationException( + "Transport dataManagementLabel() not implemented"); + } + + /** * Ask the transport where, on local device storage, to keep backup state blobs. * This is per-transport so that mock transports used for testing can coexist with * "live" backup services without interfering with the live bookkeeping. The @@ -446,6 +483,16 @@ public class BackupTransport { } @Override + public Intent dataManagementIntent() { + return BackupTransport.this.dataManagementIntent(); + } + + @Override + public String dataManagementLabel() { + return BackupTransport.this.dataManagementLabel(); + } + + @Override public String transportDirName() throws RemoteException { return BackupTransport.this.transportDirName(); } |