The pdf_printer_media_sizes array for es-US was missing
resulting in using European paper sizes for US locale and
as a result no default media size for this locale. This
resulted in printing not working for es-US.
bug:18536264
Change-Id: Ied552a63d628be38dc5249f3cd6107cbeaa692a8
The save to PDF option is truncated in Russian. While the printer
name can be arbitrarily long, the Save to PDF printer should not
be truncated.
bug:18546218
Change-Id: Id35bd638c505783a2288c1602960e8d74ec3b882
We are updating the printed content asynchronously. If the user cancels
printing before the first update is complete the spooler components are
in a destroyed state but we attempt to handle the completed update resulting
in a crash. Now if printing is cancelled we ignore the update result.
bug:18525491
Change-Id: I1ef47a17de19896cba2c7a1dd2bfc205065e0a5a
A recent change modified the way we destroy the remote renderer from
asynchronous to synchronous. This caused problems since it was possible
that the remote rendering service is unbound while we are reading the
contents of a rendered page. As a result the reader was blocking on I/O
and the print spooler was getting into a locked state that required a
restart of its process. Now the remote renderer is destroyed
asynchronously.
bug:18498626
Change-Id: I1312bf808f30430728b4038dd4be43c55d2be825
1. Available printers are provided by a loader driven by the activity
lifecycle. After a rotation of an app that does not handle rotation
the print activity is destroyed in a delayed fashion. When another
print task is started the loader of the destroed activity gets two
cancellations, one when the activity is stopped and one when it is
destroyed but when the second cancellation happens the loader has a
bad state that it is loading while it is not and a NPE occurs.
2. If a rotation happens early before the print activity is fully initialized
(there are asyncrconous operations that take place) we get a NPE as
the print preview controller is not created yet.
3. A lockup of the print preview process occurs if the print print
activity is destroyed after we initiated binding to the rendering
service but before we receive the remote interface. In this case no
remote service is received as exepcted since we already unbound from
it resulting in a missed signal.
bug:18238590
Change-Id: I81817d81702f649ded97dfbab7d7bba28f22fa91
If apps are writing malformed content (typically not a PDF file) or if the
PDF content they provide to the print system is password protected, are now
crashed as both of these are app bugs.
bug:17636435
Change-Id: Ifce6a3199e587448dd38f6a84290a965c24b698b
When rendering a PDF file for print preview we take into account
the selected print options such as paper size, orientation, etc
without modifying the document. To print we send the doc in its
original form and the print options so the print service can apply
the necessary transforms in addition to the optional custom options
it supports. When saving to PDF we have to actually change the
document as we act as a print service.
bug:13545980
Change-Id: Icdcecf962bec6ff742cc6015df5af9d9086ce760
When printing from two apps at the same time the second print UI is
getting stuck. There were a couple of issues here:
AdapterView was not notifying for item selection if the data changes
after scheduling a dalayed selection notification and the notification
execution. The code assumed that a layout pass will occur and posponed
the notification after the layout pass but it is not guaranteed that
such a layout pass will occur. Now we delay only if a layout pass is
being scheduled.
Also when binding to the PDF rendering service the print spooler was
using the same intent and as a result two print activites were getting
the same renderer instance while they should get separate ones. Now
we use different data in the intent to ensure we get separate renderer
instances.
Change-Id: I6aa7c7b041957804b4273549dd837a6d70064efc
If the printing app with the print UI on top is killed from recents we get
a crash because: 1) the remote print document was not transitioned to a
failed state if the printing app dies (this is an unrecoverable failure);
2) the print preview controller was destroyed asyncronosly during which it
also asynchronously disconnects from the rendering service which however
happens after the system has already cleaned up all connections of the print
UI activity as it is being destoryed.
bug:18109386
Change-Id: If6200b14a8aa90622228bbb659e9c4962226f561
We order printers based on past usage. In some cases the ordering
does not work. The reason for that was an incorrect assumption that
the entries in an ArrayMap are ordered in the order they are added.
bug:18109283
Change-Id: Ie367e4ca5e6bd79f335a060074c9211054e3a931
One can save only one copy to PDF. Showing more that one copy when saving
to PDF enven in a disabled input box is confusing to the user. We now set
the copies to one when the PDF printer is selected.
bug:17631303
Change-Id: Ia04d144efc899e7f3836c19349d9c87f3ae8f0f0
When saving to PDF we bring up the file picker UI which covers
the print UI. In this case the printing app may get killed as
it is not in the forground (the system is bound to the print
spooler so it cannot get killed). If that happens we are ending
up with an empty file. However, if the file chooser UI is up
we already have everything from the app we need and it dying
does not matter. This change takes care if ignoring printing
app death while saving to PDF.
bug:17922948
Change-Id: I10d808e3c3e93e850dbc2a948f2482381a887928