diff --git a/docs/html/guide/developing/tools/bmgr.jd b/docs/html/guide/developing/tools/bmgr.jd index 2f495323e67a0..57deb254c5c13 100644 --- a/docs/html/guide/developing/tools/bmgr.jd +++ b/docs/html/guide/developing/tools/bmgr.jd @@ -15,6 +15,11 @@ page.title=bmgr
For information about adding support for backup in your application, read Data Backup, which includes a guide to testing +your application using {@code bmgr}.
The data for a single application can be erased from the active data set on demand. This is
very useful while you're developing a backup agent, in case bugs lead you to write corrupt data
or saved state information. You can wipe an application's data with the bmgr wipe
@@ -102,6 +112,9 @@ you wish to
erase. The next backup operation that the application's agent processes will look as
though the application had never backed anything up before.
+
+
You can see whether the Backup Manager is operational at all with the bmgr
enabled command:
diff --git a/docs/html/guide/topics/data/backup.jd b/docs/html/guide/topics/data/backup.jd
index 4e74a833897aa..4279d7d474adf 100644
--- a/docs/html/guide/topics/data/backup.jd
+++ b/docs/html/guide/topics/data/backup.jd
@@ -33,7 +33,7 @@ page.title=Data Backup
Tip: While developing your application, you can initiate an immediate backup operation from the Backup Manager with the bmgr tool.
+href="{@docRoot}guide/developing/tools/bmgr.html">{@code bmgr} tool.When the Backup Manager calls your {@link android.app.backup.BackupAgent#onBackup(ParcelFileDescriptor,BackupDataOutput,ParcelFileDescriptor) @@ -452,7 +457,7 @@ android.app.backup.BackupManager#requestRestore(RestoreObserver) requestRestore( href="#RequestingRestore">Requesting restore for more information).
Note: While developing your application, you can also request a -restore operation with the bmgr +restore operation with the {@code bmgr} tool.
When the Backup Manager calls your {@link @@ -813,7 +818,7 @@ onBackup()}.
Note: While developing your application, you can request a backup and initiate an immediate backup operation with the bmgr +href="{@docRoot}guide/developing/tools/bmgr.html">{@code bmgr} tool.
@@ -828,25 +833,52 @@ android.app.backup.BackupAgent#onRestore(BackupDataInput,int,ParcelFileDescripto implementation, passing the data from the current set of backup data.Note: While developing your application, you can request a -restore operation with the bmgr +restore operation with the {@code bmgr} tool.
-To develop and test your backup agent:
-Once you've implemented your backup agent, you can test the backup and restore functionality +with the following procedure, using {@code bmgr}.
+ +adb shell bmgr enable true+
If you've properly implemented backup in your application, then it should request a +backup each time the data changes. For example, each time the user changes some data, your app +should call {@link android.app.backup.BackupManager#dataChanged()}, which adds a backup request to +the Backup Manager queue. For testing purposes, you can also make a request with the following +{@code bmgr} command:
+adb shell bmgr backup your.package.name+
adb shell bmgr run+
This forces the Backup Manager to perform all backup requests that are in its +queue.
+adb uninstall your.package.name+
If your backup agent is successful, all the data you initialized in step 4 is restored.
+