am: 456f1e3
* commit '456f1e33b808052377a79b91d34091a356652f2c':
Update print preview when option is changed and clear ranges when they layout changes
Change-Id: I3fcb5c9041ce0268751010e84fb2e94a0a723b29
... if it cannot connect to remote PrintDocumentAdapter. Then the state
will be set to destroyed and the print activity will be aborted via the
onDied callback.
Bug: 27899066
Change-Id: Ieb287b92ac21fc71a56b491a1035feaff6cd2837
am: c0c7ecb
* commit 'c0c7ecbea1ed88625109c7fa1162e2cc66dba45a':
Handle all configuration changes in PrintActivity as it cannot be destroyed synchronously.
am: b5be5ec
* commit 'b5be5ec3b70c2c310601e9d035b4e8fd0db8b085':
Handle all configuration changes in PrintActivity as it cannot be destroyed synchronously.
Bonus: null advanced keys produced a exception deep in the print
spooler. Hence prevent null keys on the surface from now on.
Bug: 27716355
Change-Id: I3c064956f4e670cd7091437ade06605aa8d797b0
layout changes
Before we updated the print preview when the paper size changed but not
when the page ranges changed. This is not consistent. We always change.
Also if there is a change to the options that changes the layout (i.e.
papersize, orientation, minMargins) then clear the selected ranges as
this does not make sense anymore.
This also fixes a bug that when having pages selected while we reduce
the number of pages in the preview we got a NPE.
Bonus: do not constantly re-update the options UI when range or copies
text is updated.
Bug: 27830850, 27741420
Change-Id: I7abe4a74b44ac5c5ee54d12cc0c1ca1540793f0e
destroyed synchronously.
Also: Always destroy print spooler provider when it was initialized to
avoid service leakage if print activity was finished after
onCreate but before onPrinterRegistryReady.
Bug: 27814338
Change-Id: I8401dc6e447cbd726b1a8f7c361b4ddf42e7e11d
In PrintActivity.OnPause we set the print job state based on the
PrintActivity state. The issue was that FINISHED was interpreted as
"cancel print job". Actually with FINISHED does not tell what state the
job should be in.
The only purpose of the finished state was to guard against
double-invocation of doFinish().
Hence remove this recently introduced state and use a simple boolean to
guard against doule invocation of doFinish().
Bug: 27760331
Change-Id: I0767c2b0b9c28e8904647cc832c236f67f92bcfe
of pages.
If the printing app declares more pages than the print preview pdf has
we used to throw an exception in the PDFManupulationService. This caused
the bitmap to be never written and the read-bitmap function to hang
forever. This was because read() return 0 meaning "pipe is closed" which
lead to an infinite loop. Now a read of 0 page might cause an exception
if the page is not fully read. This exception then causes the
preview_page_error to be displayed.
Bug: 27556666
Change-Id: I7b9de50dce930629e8d38efd4e2659a00b70cc4e
am: 909befe
* commit '909befe2110ffcc2ef375019077dc563c33e00cd':
Treat all remotedocumentadapter-command results as cancel in the case we are canceling the command.
am: ef5577a
* commit 'ef5577a15dfc652edcfeaab46cdea830b749f1b8':
Treat all remotedocumentadapter-command results as cancel in the case we are canceling the command.
are canceling the command.
Before it could happen that we have a pending cancel on a layout command
but the layout command finishes normally. This enqueued a new write
command before the PrintActivity is notified. This in turn prevented the
printactivity from finishing as the write command was still pending.
Bug: 27642724
Change-Id: I3c532d53b0c66c40d2e48ab8b4419251ff473a79
In this case it cannot call back into the recyclerView and update the
data. For the call path please see the bug.
Bug: 27614499
Change-Id: I84733fea30429c20a2c96085efb47d4da5e1948a
This fixes two bugs
(1)
1. Printer was unknown when "all printer" activity was opened
2. Printer gets selected in "all printers" activity
3. Printer is unknown at the time the activity returns and thereby does
not get selected
(2)
If a print service gets disabled _all_ printers of the print service
will be marked as "removed" but do not removed from the adapter. This
is superflous as none of them can be selected anymore. The only thing
we want to make sure of is that the currently selected printer does
not get removed.
The workflow is now always:
- set mCurrentPrinter if needed
- Adjust mPrinterHolders
- adapter.notifyDataSetChanged()
-> PrintersObserver.onChanged()
-> onItemSelected
Bug: 27643305
Change-Id: I35ea7078367ad5a918c6362c04a26c4326e6c3f4