From 337b0873f43eac5f23483bec94bd8729f79d47ec Mon Sep 17 00:00:00 2001
From: Scott Main 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 You can see whether the Backup Manager is operational at all with the Tip: While developing your application, you can initiate an
immediate backup operation from the Backup Manager with the bmgr tool.See also
+
+
+
@@ -26,6 +31,9 @@ and restore operations so that you don't need to repeatedly wipe data or take si
intrusive steps in order to test your application's backup agent. These commands are
accessed via the adb shell.
+Forcing a Backup Operation
@@ -90,6 +98,8 @@ will happen even if your application is not currently running.
Other Commands
+Wiping data
+
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.
+
+Enabling and disabling backup
+
bmgr
enabled command:
diff --git a/docs/html/guide/topics/data/backup.jd b/docs/html/guide/topics/data/backup.jd
index 4e74a83..4279d7d 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
Key classes
@@ -43,6 +43,11 @@ page.title=Data Backup
See also
+
+
@@ -308,7 +313,7 @@ backup for all applications that have requested a backup since the last backup w
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.
+ -- cgit v1.1