Deal gracefully with fatal exceptions during full backup

In particular, if the low-level zip or crypto layers of the output
pipeline throw, the output becomes invalid at that point, but we
were not properly detecting this; we were missing the exception and
the runtime was going down.  Now we catch any such fatal exception
and make sure to shut down the backup operation cleanly, leaving
the output at whatever point in its construction that it had
achieved.

Bug 6131870

Change-Id: If0fe0337857404b776f407a79d11dd88b8e60fd0
This commit is contained in:
Christopher Tate
2012-03-23 13:56:34 -07:00
parent 54c546223c
commit aa0c02d221

View File

@ -2547,6 +2547,8 @@ class BackupManagerService extends IBackupManager.Stub {
finalizeBackup(out);
} catch (RemoteException e) {
Slog.e(TAG, "App died during full backup");
} catch (Exception e) {
Slog.e(TAG, "Internal exception during full backup", e);
} finally {
tearDown(pkg);
try {