Loading core/java/android/app/backup/BackupTransport.java +4 −0 Original line number Diff line number Diff line Loading @@ -331,6 +331,10 @@ public class BackupTransport { * its datastore, if appropriate, and close the socket that had been provided in * {@link #performFullBackup(PackageInfo, ParcelFileDescriptor)}. * * <p class="note">If the transport returns TRANSPORT_OK from this method, then the * OS will always provide a matching call to {@link #finishBackup()} even if sending * data via {@link #sendBackupData(int)} failed at some point. * * @param targetPackage The package whose data is to follow. * @param socket The socket file descriptor through which the data will be provided. * If the transport returns {@link #TRANSPORT_PACKAGE_REJECTED} here, it must still Loading services/backup/java/com/android/server/backup/BackupManagerService.java +18 −7 Original line number Diff line number Diff line Loading @@ -3535,19 +3535,30 @@ public class BackupManagerService extends IBackupManager.Stub { } } while (nRead > 0 && result == BackupTransport.TRANSPORT_OK); // Done -- how did it turn out? // In all cases we need to give the transport its finish callback int finishResult = transport.finishBackup(); // If we were otherwise in a good state, now interpret the final // result based on what finishBackup() returned. If we're in a // failure case already, preserve that result and ignore whatever // finishBackup() reported. if (result == BackupTransport.TRANSPORT_OK) { result = transport.finishBackup(); } else { Slog.w(TAG, "Error backing up " + target.packageName); result = finishResult; } if (result != BackupTransport.TRANSPORT_OK) { Slog.e(TAG, "Error " + result + " backing up " + target.packageName); } } else if (result == BackupTransport.TRANSPORT_PACKAGE_REJECTED) { } if (result == BackupTransport.TRANSPORT_PACKAGE_REJECTED) { if (DEBUG) { Slog.i(TAG, "Transport rejected backup of " + target.packageName + ", skipping"); } // do nothing, clean up, and continue looping } else { } else if (result != BackupTransport.TRANSPORT_OK) { if (DEBUG) { Slog.i(TAG, "Transport failed; aborting backup"); return; Loading Loading
core/java/android/app/backup/BackupTransport.java +4 −0 Original line number Diff line number Diff line Loading @@ -331,6 +331,10 @@ public class BackupTransport { * its datastore, if appropriate, and close the socket that had been provided in * {@link #performFullBackup(PackageInfo, ParcelFileDescriptor)}. * * <p class="note">If the transport returns TRANSPORT_OK from this method, then the * OS will always provide a matching call to {@link #finishBackup()} even if sending * data via {@link #sendBackupData(int)} failed at some point. * * @param targetPackage The package whose data is to follow. * @param socket The socket file descriptor through which the data will be provided. * If the transport returns {@link #TRANSPORT_PACKAGE_REJECTED} here, it must still Loading
services/backup/java/com/android/server/backup/BackupManagerService.java +18 −7 Original line number Diff line number Diff line Loading @@ -3535,19 +3535,30 @@ public class BackupManagerService extends IBackupManager.Stub { } } while (nRead > 0 && result == BackupTransport.TRANSPORT_OK); // Done -- how did it turn out? // In all cases we need to give the transport its finish callback int finishResult = transport.finishBackup(); // If we were otherwise in a good state, now interpret the final // result based on what finishBackup() returned. If we're in a // failure case already, preserve that result and ignore whatever // finishBackup() reported. if (result == BackupTransport.TRANSPORT_OK) { result = transport.finishBackup(); } else { Slog.w(TAG, "Error backing up " + target.packageName); result = finishResult; } if (result != BackupTransport.TRANSPORT_OK) { Slog.e(TAG, "Error " + result + " backing up " + target.packageName); } } else if (result == BackupTransport.TRANSPORT_PACKAGE_REJECTED) { } if (result == BackupTransport.TRANSPORT_PACKAGE_REJECTED) { if (DEBUG) { Slog.i(TAG, "Transport rejected backup of " + target.packageName + ", skipping"); } // do nothing, clean up, and continue looping } else { } else if (result != BackupTransport.TRANSPORT_OK) { if (DEBUG) { Slog.i(TAG, "Transport failed; aborting backup"); return; Loading