diff options
author | Christopher Tate <ctate@google.com> | 2014-06-03 17:20:07 -0700 |
---|---|---|
committer | Christopher Tate <ctate@google.com> | 2014-06-15 17:35:33 -0700 |
commit | 9ff53a7100b1a40f5d2df3eb19a2f3f2fff39a46 (patch) | |
tree | 162c23a51e116f9506e7d6801236dd2e2c8f3788 /cmds/bmgr/src | |
parent | ad60891a6ecaf2a5815677b33e96afe7f49ee113 (diff) | |
download | frameworks_base-9ff53a7100b1a40f5d2df3eb19a2f3f2fff39a46.zip frameworks_base-9ff53a7100b1a40f5d2df3eb19a2f3f2fff39a46.tar.gz frameworks_base-9ff53a7100b1a40f5d2df3eb19a2f3f2fff39a46.tar.bz2 |
Implement full data backup through transport
Currently no timed/scheduled full-data backup operations are
performed by the OS, but the plumbing is now in place and can
be tested using 'adb shell bmgr fullbackup pkg [pkg2 pkg3 ...]'.
The LocalTransport test transport implementation has been augmented
to support the new full-data backup API as well.
In addition, 'adb backup' now takes the -compress/-nocompress
command line options to control whether the resulting archive is
compressed before leaving the device. Previously the archive was
always compressed. (The default is still to compress, as it will
usually reduce the archive size considerably.)
Internally, the core implementation of gathering the full backup
data stream from the target application has been refactored into
an "engine" component that is shared by both 'adb backup' and the
transport-oriented full backup task. The archive file header
generation, encryption, and compression logic are now factored out
of the engine itself instead of being hardwired into the data
handling.
Bug 15329632
Change-Id: I4a044faa4070d684ef457bd3e11771198cdf557c
Diffstat (limited to 'cmds/bmgr/src')
-rw-r--r-- | cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java b/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java index db3d8bb..d1bea2e 100644 --- a/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java +++ b/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java @@ -23,6 +23,7 @@ import android.app.backup.IRestoreSession; import android.os.RemoteException; import android.os.ServiceManager; +import java.util.ArrayList; import java.util.HashSet; public final class Bmgr { @@ -102,6 +103,11 @@ public final class Bmgr { return; } + if ("fullbackup".equals(op)) { + doFullTransportBackup(); + return; + } + System.err.println("Unknown command"); showUsage(); } @@ -165,6 +171,21 @@ public final class Bmgr { } } + private void doFullTransportBackup() { + System.out.println("Performing full transport backup"); + + String pkg; + while ((pkg = nextArg()) != null) { + System.out.println(" Package " + pkg + " ..."); + try { + mBmgr.fullTransportBackup(new String[] { pkg }); + } catch (RemoteException e) { + System.err.println(e.toString()); + System.err.println(BMGR_NOT_RUNNING_ERR); + } + } + } + private void doTransport() { try { String which = nextArg(); |