summaryrefslogtreecommitdiff
path: root/libs/utils/BackupHelpers.cpp
diff options
context:
space:
mode:
author Christopher Tate <ctate@google.com> 2011-05-18 16:28:19 -0700
committer Christopher Tate <ctate@google.com> 2011-06-01 15:09:55 -0700
commit15e113033bf75fe1a5b998f6e69c9cac0691e187 (patch)
treefeab4fdc85c1da9c1b6498086b3ad7ff3c1f4c93 /libs/utils/BackupHelpers.cpp
parentc507859dd8309825658ffcb944e3f13f922f18dd (diff)
Restore from a previous full backup's tarfile
Usage: adb restore [tarfilename] Restores app data [and installs the apps if necessary from the backup file] captured in a previous invocation of 'adb backup'. The user must explicitly acknowledge the action on-device before it is allowed to proceed; this prevents any "invisible" pushes of content from the host to the device. Known issues: * The settings databases and wallpaper are saved/restored, but lots of other system state is not yet captured in the full backup. This means that for practical purposes this is usable for 3rd party apps at present but not for full-system cloning/imaging. Change-Id: I0c748b645845e7c9178e30bf142857861a64efd3
Diffstat (limited to 'libs/utils/BackupHelpers.cpp')
-rw-r--r--libs/utils/BackupHelpers.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/libs/utils/BackupHelpers.cpp b/libs/utils/BackupHelpers.cpp
index e15875f380..f933199fe8 100644
--- a/libs/utils/BackupHelpers.cpp
+++ b/libs/utils/BackupHelpers.cpp
@@ -503,6 +503,16 @@ int write_tarfile(const String8& packageName, const String8& domain,
needExtended = true;
}
+ // Non-7bit-clean path also means needing pax extended format
+ if (!needExtended) {
+ for (size_t i = 0; i < filepath.length(); i++) {
+ if ((filepath[i] & 0x80) != 0) {
+ needExtended = true;
+ break;
+ }
+ }
+ }
+
int err = 0;
struct stat64 s;
if (lstat64(filepath.string(), &s) != 0) {