OSDN Git Service

Do not allow printing until preview is updated
authorPhilip P. Moltmann <moltmann@google.com>
Fri, 24 Mar 2017 23:17:13 +0000 (16:17 -0700)
committerPhilip P. Moltmann <moltmann@google.com>
Wed, 29 Mar 2017 16:13:32 +0000 (16:13 +0000)
commitd0e44c5ee32976b24b9b1377d9ece94a59db7df5
tree621f9a9daef34cffbbce4b6c6a3f3311d1837ded
parent1af2928767af7ffd95ce61946b95a7b5ef877bd5
Do not allow printing until preview is updated

Otherwise we might end up in the situation where we print something that
was not previewed.
This is of course bad for the user as he prints something he has not seen.
It is also bad for the print spooler as in the case the layout did not
describe the amount of pages, we do not know the number of pages available
until the update is complete.

We now allow changing of printer at any time unless printing is in final
stage. If we don't allow this the changing of printer would be blocked
until the intial document was written which might take some time.

Fixes: 36599750
Test: cts-tradefed run cts-dev -m Print
Change-Id: I93e910c02f2a770008b845028f0adf17b3d410e2
(cherry picked from commit 378cddbc41dae55e9a11faaa251b80fb90878b34)
packages/PrintSpooler/src/com/android/printspooler/model/RemotePrintDocument.java
packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java