summaryrefslogtreecommitdiffstats
path: root/cmds/bu
diff options
context:
space:
mode:
authorChristopher Tate <ctate@google.com>2014-06-03 17:20:07 -0700
committerChristopher Tate <ctate@google.com>2014-06-15 17:35:33 -0700
commit9ff53a7100b1a40f5d2df3eb19a2f3f2fff39a46 (patch)
tree162c23a51e116f9506e7d6801236dd2e2c8f3788 /cmds/bu
parentad60891a6ecaf2a5815677b33e96afe7f49ee113 (diff)
downloadframeworks_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/bu')
-rw-r--r--cmds/bu/src/com/android/commands/bu/Backup.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmds/bu/src/com/android/commands/bu/Backup.java b/cmds/bu/src/com/android/commands/bu/Backup.java
index 4503726..ffc0f87 100644
--- a/cmds/bu/src/com/android/commands/bu/Backup.java
+++ b/cmds/bu/src/com/android/commands/bu/Backup.java
@@ -69,6 +69,7 @@ public final class Backup {
boolean doEverything = false;
boolean doWidgets = false;
boolean allIncludesSystem = true;
+ boolean doCompress = true;
String arg;
while ((arg = nextArg()) != null) {
@@ -95,6 +96,10 @@ public final class Backup {
doWidgets = false;
} else if ("-all".equals(arg)) {
doEverything = true;
+ } else if ("-compress".equals(arg)) {
+ doCompress = true;
+ } else if ("-nocompress".equals(arg)) {
+ doCompress = false;
} else {
Log.w(TAG, "Unknown backup flag " + arg);
continue;
@@ -119,7 +124,7 @@ public final class Backup {
fd = ParcelFileDescriptor.adoptFd(socketFd);
String[] packArray = new String[packages.size()];
mBackupManager.fullBackup(fd, saveApks, saveObbs, saveShared, doWidgets,
- doEverything, allIncludesSystem, packages.toArray(packArray));
+ doEverything, allIncludesSystem, doCompress, packages.toArray(packArray));
} catch (RemoteException e) {
Log.e(TAG, "Unable to invoke backup manager for backup");
} finally {