am bbebe423: Merge "adb backup/restore fixes" into lmp-dev
* commit 'bbebe42309a7012e0474b916f5209027889e8d57': adb backup/restore fixes
This commit is contained in:
@@ -3511,7 +3511,7 @@ public class BackupManagerService extends IBackupManager.Stub {
|
|||||||
PackageInfo pkg = allPackages.get(i);
|
PackageInfo pkg = allPackages.get(i);
|
||||||
// Exclude system apps if we've been asked to do so
|
// Exclude system apps if we've been asked to do so
|
||||||
if (mIncludeSystem == true
|
if (mIncludeSystem == true
|
||||||
|| ((pkg.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0)) {
|
|| ((pkg.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0)) {
|
||||||
packagesToBackup.put(pkg.packageName, pkg);
|
packagesToBackup.put(pkg.packageName, pkg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4344,6 +4344,7 @@ public class BackupManagerService extends IBackupManager.Stub {
|
|||||||
} else if (info.path.equals(BACKUP_METADATA_FILENAME)) {
|
} else if (info.path.equals(BACKUP_METADATA_FILENAME)) {
|
||||||
// Metadata blobs!
|
// Metadata blobs!
|
||||||
readMetadata(info, instream);
|
readMetadata(info, instream);
|
||||||
|
skipTarPadding(info.size, instream);
|
||||||
} else {
|
} else {
|
||||||
// Non-manifest, so it's actual file data. Is this a package
|
// Non-manifest, so it's actual file data. Is this a package
|
||||||
// we're ignoring?
|
// we're ignoring?
|
||||||
@@ -5160,8 +5161,10 @@ public class BackupManagerService extends IBackupManager.Stub {
|
|||||||
info.packageName = info.path.substring(0, slash);
|
info.packageName = info.path.substring(0, slash);
|
||||||
info.path = info.path.substring(slash+1);
|
info.path = info.path.substring(slash+1);
|
||||||
|
|
||||||
// if it's a manifest we're done, otherwise parse out the domains
|
// if it's a manifest or metadata payload we're done, otherwise parse
|
||||||
if (!info.path.equals(BACKUP_MANIFEST_FILENAME)) {
|
// out the domain into which the file will be restored
|
||||||
|
if (!info.path.equals(BACKUP_MANIFEST_FILENAME)
|
||||||
|
&& !info.path.equals(BACKUP_METADATA_FILENAME)) {
|
||||||
slash = info.path.indexOf('/');
|
slash = info.path.indexOf('/');
|
||||||
if (slash < 0) {
|
if (slash < 0) {
|
||||||
throw new IOException("Illegal semantic path in non-manifest "
|
throw new IOException("Illegal semantic path in non-manifest "
|
||||||
@@ -5706,6 +5709,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
|
|||||||
} else if (info.path.equals(BACKUP_METADATA_FILENAME)) {
|
} else if (info.path.equals(BACKUP_METADATA_FILENAME)) {
|
||||||
// Metadata blobs!
|
// Metadata blobs!
|
||||||
readMetadata(info, instream);
|
readMetadata(info, instream);
|
||||||
|
skipTarPadding(info.size, instream);
|
||||||
} else {
|
} else {
|
||||||
// Non-manifest, so it's actual file data. Is this a package
|
// Non-manifest, so it's actual file data. Is this a package
|
||||||
// we're ignoring?
|
// we're ignoring?
|
||||||
@@ -6482,8 +6486,10 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
|
|||||||
info.packageName = info.path.substring(0, slash);
|
info.packageName = info.path.substring(0, slash);
|
||||||
info.path = info.path.substring(slash+1);
|
info.path = info.path.substring(slash+1);
|
||||||
|
|
||||||
// if it's a manifest we're done, otherwise parse out the domains
|
// if it's a manifest or metadata payload we're done, otherwise parse
|
||||||
if (!info.path.equals(BACKUP_MANIFEST_FILENAME)) {
|
// out the domain into which the file will be restored
|
||||||
|
if (!info.path.equals(BACKUP_MANIFEST_FILENAME)
|
||||||
|
&& !info.path.equals(BACKUP_METADATA_FILENAME)) {
|
||||||
slash = info.path.indexOf('/');
|
slash = info.path.indexOf('/');
|
||||||
if (slash < 0) throw new IOException("Illegal semantic path in non-manifest " + info.path);
|
if (slash < 0) throw new IOException("Illegal semantic path in non-manifest " + info.path);
|
||||||
info.domain = info.path.substring(0, slash);
|
info.domain = info.path.substring(0, slash);
|
||||||
@@ -8160,7 +8166,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
|
|||||||
|
|
||||||
if (DEBUG) Slog.v(TAG, "Requesting full backup: apks=" + includeApks
|
if (DEBUG) Slog.v(TAG, "Requesting full backup: apks=" + includeApks
|
||||||
+ " obb=" + includeObbs + " shared=" + includeShared + " all=" + doAllApps
|
+ " obb=" + includeObbs + " shared=" + includeShared + " all=" + doAllApps
|
||||||
+ " pkgs=" + pkgList);
|
+ " system=" + includeSystem + " pkgs=" + pkgList);
|
||||||
Slog.i(TAG, "Beginning full backup...");
|
Slog.i(TAG, "Beginning full backup...");
|
||||||
|
|
||||||
FullBackupParams params = new FullBackupParams(fd, includeApks, includeObbs,
|
FullBackupParams params = new FullBackupParams(fd, includeApks, includeObbs,
|
||||||
|
|||||||
Reference in New Issue
Block a user