OSDN Git Service

PrintDocumentAdapter contract not followed on print.
authorSvetoslav <svetoslavganov@google.com>
Fri, 20 Sep 2013 18:58:55 +0000 (11:58 -0700)
committerSvetoslav <svetoslavganov@google.com>
Fri, 20 Sep 2013 19:15:22 +0000 (12:15 -0700)
commit5559c368a96c56d55c581c88d9978c59c5212bf1
tree330fec8337554c2d00a7bfb7cced7b6588fcd294
parent5006eb75e6d42ac107734fa8134a726158d768d8
PrintDocumentAdapter contract not followed on print.

1. Layout was not called after pressing the print button if the
   print attributes did not change. This is not correct since the
   previous layout calls were for preview purposes and the one
   after pressing print is not for preview. Hence, we always have
   to do this layout.

2. After layout we decide whether to ask the app to write some
   pages. We ask for a write if we do not have the pages selected
   by the user or the document changed (if the page count changed,
   the document type changed, or the app told us that the content
   changed). We were not computing correctly whether the document
   changed since we compared the size but the document info the
   app passes in after a layout does not have the size yet. We set
   the size after a write. So for layout purposes we should ignore
   the size. We only care if the page count, document type, or
   content changed where the latter is reported by the app in
   the layout callback.

3. We were not updating the PrintJob after setting the data
   size of the printed document.

4. Disabled debugging.

bug:10835370

Change-Id: Ic3b2871b4e954cdf610f8cf806de5fc6588a6bec
packages/PrintSpooler/src/com/android/printspooler/PrintJobConfigActivity.java