Merge "Set PrintDocumentInfo#mDataSize" into nyc-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
ba229ce88a
@@ -526,6 +526,14 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
|
|||||||
.setContentType(info.getContentType())
|
.setContentType(info.getContentType())
|
||||||
.setPageCount(pageCount)
|
.setPageCount(pageCount)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
File file = mFileProvider.acquireFile(null);
|
||||||
|
try {
|
||||||
|
adjustedInfo.setDataSize(file.length());
|
||||||
|
} finally {
|
||||||
|
mFileProvider.releaseFile();
|
||||||
|
}
|
||||||
|
|
||||||
mPrintJob.setDocumentInfo(adjustedInfo);
|
mPrintJob.setDocumentInfo(adjustedInfo);
|
||||||
mPrintJob.setPages(document.printedPages);
|
mPrintJob.setPages(document.printedPages);
|
||||||
}
|
}
|
||||||
@@ -3077,6 +3085,14 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
|
|||||||
.setContentType(oldDocInfo.getContentType())
|
.setContentType(oldDocInfo.getContentType())
|
||||||
.setPageCount(newPageCount)
|
.setPageCount(newPageCount)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
File file = mFileProvider.acquireFile(null);
|
||||||
|
try {
|
||||||
|
newDocInfo.setDataSize(file.length());
|
||||||
|
} finally {
|
||||||
|
mFileProvider.releaseFile();
|
||||||
|
}
|
||||||
|
|
||||||
mPrintJob.setDocumentInfo(newDocInfo);
|
mPrintJob.setDocumentInfo(newDocInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user