Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 59397a8e authored by Christopher Tate's avatar Christopher Tate
Browse files

Explicitly flush compress/encrypt stream before close

We're losing the stream footer for mysterious reasons; maybe this
will help even though supposedly close() is expected to flush pending
buffered writes anyway.  In particular, an explicit flush of the
compression stage will generate a SYNC_FLUSH point, which ordinary
deflate-at-close operation does not.

Bug 28056941

Change-Id: I96580411257932d7addb176c6672eae72a5ac6f7
parent a2a6533d
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -4315,7 +4315,10 @@ public class BackupManagerService {
                Slog.e(TAG, "Internal exception during full backup", e);
            } finally {
                try {
                    if (out != null) out.close();
                    if (out != null) {
                        out.flush();
                        out.close();
                    }
                    mOutputFile.close();
                } catch (IOException e) {
                    /* nothing we can do about this */