Loading core/java/com/android/internal/backup/LocalTransport.java +4 −1 Original line number Diff line number Diff line Loading @@ -271,6 +271,9 @@ public class LocalTransport extends BackupTransport { mFullTargetPackage = null; mSocket.close(); } catch (IOException e) { if (DEBUG) { Log.w(TAG, "Exception caught in finishBackup()", e); } return TRANSPORT_ERROR; } finally { mSocket = null; Loading Loading @@ -576,7 +579,7 @@ public class LocalTransport extends BackupTransport { return TRANSPORT_PACKAGE_REJECTED; } mFullRestoreSocketStream = new FileOutputStream(socket.getFileDescriptor()); mFullRestoreBuffer = new byte[32*1024]; mFullRestoreBuffer = new byte[2*1024]; } int nRead; Loading services/backup/java/com/android/server/backup/BackupManagerService.java +18 −1 Original line number Diff line number Diff line Loading @@ -3539,6 +3539,11 @@ public class BackupManagerService extends IBackupManager.Stub { // In all cases we need to give the transport its finish callback int finishResult = transport.finishBackup(); if (MORE_DEBUG) { Slog.i(TAG, "Done trying to send backup data: result=" + result + " finishResult=" + finishResult); } // 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 Loading @@ -3561,7 +3566,7 @@ public class BackupManagerService extends IBackupManager.Stub { // do nothing, clean up, and continue looping } else if (result != BackupTransport.TRANSPORT_OK) { if (DEBUG) { Slog.i(TAG, "Transport failed; aborting backup"); Slog.i(TAG, "Transport failed; aborting backup: " + result); return; } } Loading Loading @@ -4083,6 +4088,9 @@ public class BackupManagerService extends IBackupManager.Stub { // okay, if the remote end failed at any point, deal with // it by ignoring the rest of the restore on it if (!agentSuccess) { if (DEBUG) { Slog.i(TAG, "Agent failure; ending restore"); } mBackupHandler.removeMessages(MSG_TIMEOUT); tearDownPipes(); tearDownAgent(mTargetApp); Loading Loading @@ -4124,6 +4132,11 @@ public class BackupManagerService extends IBackupManager.Stub { // If we got here we're either running smoothly or we've finished if (info == null) { if (MORE_DEBUG) { Slog.i(TAG, "No [more] data for this package; tearing down"); } tearDownPipes(); tearDownAgent(mTargetApp); setRunning(false); } return (info != null); Loading Loading @@ -7064,6 +7077,10 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF // Don't proceed until the engine has torn down the agent etc eThread.waitForResult(); if (MORE_DEBUG) { Slog.i(TAG, "engine thread finished; proceeding"); } // Now we're really done with this one too IoUtils.closeQuietly(mEnginePipes[0]); Loading Loading
core/java/com/android/internal/backup/LocalTransport.java +4 −1 Original line number Diff line number Diff line Loading @@ -271,6 +271,9 @@ public class LocalTransport extends BackupTransport { mFullTargetPackage = null; mSocket.close(); } catch (IOException e) { if (DEBUG) { Log.w(TAG, "Exception caught in finishBackup()", e); } return TRANSPORT_ERROR; } finally { mSocket = null; Loading Loading @@ -576,7 +579,7 @@ public class LocalTransport extends BackupTransport { return TRANSPORT_PACKAGE_REJECTED; } mFullRestoreSocketStream = new FileOutputStream(socket.getFileDescriptor()); mFullRestoreBuffer = new byte[32*1024]; mFullRestoreBuffer = new byte[2*1024]; } int nRead; Loading
services/backup/java/com/android/server/backup/BackupManagerService.java +18 −1 Original line number Diff line number Diff line Loading @@ -3539,6 +3539,11 @@ public class BackupManagerService extends IBackupManager.Stub { // In all cases we need to give the transport its finish callback int finishResult = transport.finishBackup(); if (MORE_DEBUG) { Slog.i(TAG, "Done trying to send backup data: result=" + result + " finishResult=" + finishResult); } // 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 Loading @@ -3561,7 +3566,7 @@ public class BackupManagerService extends IBackupManager.Stub { // do nothing, clean up, and continue looping } else if (result != BackupTransport.TRANSPORT_OK) { if (DEBUG) { Slog.i(TAG, "Transport failed; aborting backup"); Slog.i(TAG, "Transport failed; aborting backup: " + result); return; } } Loading Loading @@ -4083,6 +4088,9 @@ public class BackupManagerService extends IBackupManager.Stub { // okay, if the remote end failed at any point, deal with // it by ignoring the rest of the restore on it if (!agentSuccess) { if (DEBUG) { Slog.i(TAG, "Agent failure; ending restore"); } mBackupHandler.removeMessages(MSG_TIMEOUT); tearDownPipes(); tearDownAgent(mTargetApp); Loading Loading @@ -4124,6 +4132,11 @@ public class BackupManagerService extends IBackupManager.Stub { // If we got here we're either running smoothly or we've finished if (info == null) { if (MORE_DEBUG) { Slog.i(TAG, "No [more] data for this package; tearing down"); } tearDownPipes(); tearDownAgent(mTargetApp); setRunning(false); } return (info != null); Loading Loading @@ -7064,6 +7077,10 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF // Don't proceed until the engine has torn down the agent etc eThread.waitForResult(); if (MORE_DEBUG) { Slog.i(TAG, "engine thread finished; proceeding"); } // Now we're really done with this one too IoUtils.closeQuietly(mEnginePipes[0]); Loading