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

Commit d65493c6 authored by Benjamin Gordon's avatar Benjamin Gordon
Browse files

PrintSpooler: Require empty output for PDF

When saving to PDF, request a truncated output stream in case the user
selects to overwrite an existing file.

Bug: 423815728
Test: Overwrite existing PDF
Flag: EXEMPT bugfix
Change-Id: Id598cd1a9d2456566f3905432eb7b5ffeab9d33e
parent c933c6ad
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -381,7 +381,7 @@ public final class RemotePrintDocument {
        try {
            file = mDocumentInfo.fileProvider.acquireFile(null);
            in = new FileInputStream(file);
            out = contentResolver.openOutputStream(uri);
            out = contentResolver.openOutputStream(uri, "wt");
            final byte[] buffer = new byte[8192];
            while (true) {
                final int readByteCount = in.read(buffer);