Loading core/java/android/app/backup/BackupTransport.java +5 −0 Original line number Diff line number Diff line Loading @@ -589,6 +589,11 @@ public class BackupTransport { return BackupTransport.this.sendBackupData(numBytes); } @Override public void cancelFullBackup() throws RemoteException { BackupTransport.this.cancelFullBackup(); } @Override public int getNextFullRestoreDataChunk(ParcelFileDescriptor socket) { return BackupTransport.this.getNextFullRestoreDataChunk(socket); Loading core/java/com/android/internal/backup/IBackupTransport.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -239,6 +239,7 @@ interface IBackupTransport { long requestFullBackupTime(); int performFullBackup(in PackageInfo targetPackage, in ParcelFileDescriptor socket); int sendBackupData(int numBytes); void cancelFullBackup(); // full restore stuff Loading services/backup/java/com/android/server/backup/BackupManagerService.java +14 −17 Original line number Diff line number Diff line Loading @@ -3745,29 +3745,26 @@ public class BackupManagerService extends IBackupManager.Stub { } } while (nRead > 0 && result == BackupTransport.TRANSPORT_OK); int finishResult; // If we've lost our running criteria, tell the transport to cancel // and roll back this (partial) backup payload; otherwise tell it // that we've reached the clean finish state. if (!mKeepRunning.get()) { result = BackupTransport.TRANSPORT_ERROR; // TODO: tell the transport to abort the backup Slog.w(TAG, "TODO: tell transport to halt & roll back"); } // In all cases we need to give the transport its finish callback finishResult = transport.finishBackup(); if (MORE_DEBUG) { Slog.i(TAG, "Done trying to send backup data: result=" + result + " finishResult=" + finishResult); } transport.cancelFullBackup(); } else { // If we were otherwise in a good state, now interpret the final // result based on what finishBackup() returned. If we're in a // result based on what finishBackup() returns. If we're in a // failure case already, preserve that result and ignore whatever // finishBackup() reported. // finishBackup() reports. final int finishResult = transport.finishBackup(); if (result == BackupTransport.TRANSPORT_OK) { result = finishResult; } } if (MORE_DEBUG) { Slog.i(TAG, "Done trying to send backup data: result=" + result); } if (result != BackupTransport.TRANSPORT_OK) { Slog.e(TAG, "Error " + result Loading Loading
core/java/android/app/backup/BackupTransport.java +5 −0 Original line number Diff line number Diff line Loading @@ -589,6 +589,11 @@ public class BackupTransport { return BackupTransport.this.sendBackupData(numBytes); } @Override public void cancelFullBackup() throws RemoteException { BackupTransport.this.cancelFullBackup(); } @Override public int getNextFullRestoreDataChunk(ParcelFileDescriptor socket) { return BackupTransport.this.getNextFullRestoreDataChunk(socket); Loading
core/java/com/android/internal/backup/IBackupTransport.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -239,6 +239,7 @@ interface IBackupTransport { long requestFullBackupTime(); int performFullBackup(in PackageInfo targetPackage, in ParcelFileDescriptor socket); int sendBackupData(int numBytes); void cancelFullBackup(); // full restore stuff Loading
services/backup/java/com/android/server/backup/BackupManagerService.java +14 −17 Original line number Diff line number Diff line Loading @@ -3745,29 +3745,26 @@ public class BackupManagerService extends IBackupManager.Stub { } } while (nRead > 0 && result == BackupTransport.TRANSPORT_OK); int finishResult; // If we've lost our running criteria, tell the transport to cancel // and roll back this (partial) backup payload; otherwise tell it // that we've reached the clean finish state. if (!mKeepRunning.get()) { result = BackupTransport.TRANSPORT_ERROR; // TODO: tell the transport to abort the backup Slog.w(TAG, "TODO: tell transport to halt & roll back"); } // In all cases we need to give the transport its finish callback finishResult = transport.finishBackup(); if (MORE_DEBUG) { Slog.i(TAG, "Done trying to send backup data: result=" + result + " finishResult=" + finishResult); } transport.cancelFullBackup(); } else { // If we were otherwise in a good state, now interpret the final // result based on what finishBackup() returned. If we're in a // result based on what finishBackup() returns. If we're in a // failure case already, preserve that result and ignore whatever // finishBackup() reported. // finishBackup() reports. final int finishResult = transport.finishBackup(); if (result == BackupTransport.TRANSPORT_OK) { result = finishResult; } } if (MORE_DEBUG) { Slog.i(TAG, "Done trying to send backup data: result=" + result); } if (result != BackupTransport.TRANSPORT_OK) { Slog.e(TAG, "Error " + result Loading