summaryrefslogtreecommitdiffstats
path: root/cmds/bu/src
diff options
context:
space:
mode:
authorChristopher Tate <ctate@google.com>2011-10-03 18:13:44 -0700
committerChristopher Tate <ctate@google.com>2011-10-04 15:35:00 -0700
commit240c7d2d1fb2944ee6a6f1dee41c7bbd766f8f0d (patch)
tree1e512dba224bc80c1eeb58411b7d508317699958 /cmds/bu/src
parentbe25ca2997ab98e1257d5625dd510e643dcead95 (diff)
downloadframeworks_base-240c7d2d1fb2944ee6a6f1dee41c7bbd766f8f0d.zip
frameworks_base-240c7d2d1fb2944ee6a6f1dee41c7bbd766f8f0d.tar.gz
frameworks_base-240c7d2d1fb2944ee6a6f1dee41c7bbd766f8f0d.tar.bz2
Add -nosystem flag to adb backup
This makes it easy to back up everything that belongs to 3rd party apps, but nothing that comes with the system per se. If any system packages are explicitly named on the command line they will be included in the backup even if -nosystem was passed. So, for example, this will back up all 3rd party apps as well as system settings, but nothing else belonging to system-deployed apps: adb backup -all -nosystem com.android.provider.settings Bug 5361503 Change-Id: Iebe04b7d7027ca58b9f55e8eb7f219d6cca69269
Diffstat (limited to 'cmds/bu/src')
-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 4c4bf98..046ccca 100644
--- a/cmds/bu/src/com/android/commands/bu/Backup.java
+++ b/cmds/bu/src/com/android/commands/bu/Backup.java
@@ -66,6 +66,7 @@ public final class Backup {
boolean saveApks = false;
boolean saveShared = false;
boolean doEverything = false;
+ boolean allIncludesSystem = true;
String arg;
while ((arg = nextArg()) != null) {
@@ -78,6 +79,10 @@ public final class Backup {
saveShared = true;
} else if ("-noshared".equals(arg)) {
saveShared = false;
+ } else if ("-system".equals(arg)) {
+ allIncludesSystem = true;
+ } else if ("-nosystem".equals(arg)) {
+ allIncludesSystem = false;
} else if ("-all".equals(arg)) {
doEverything = true;
} else {
@@ -102,7 +107,7 @@ public final class Backup {
try {
ParcelFileDescriptor fd = ParcelFileDescriptor.adoptFd(socketFd);
String[] packArray = new String[packages.size()];
- mBackupManager.fullBackup(fd, saveApks, saveShared, doEverything,
+ mBackupManager.fullBackup(fd, saveApks, saveShared, doEverything, allIncludesSystem,
packages.toArray(packArray));
} catch (RemoteException e) {
Log.e(TAG, "Unable to invoke backup manager for backup");