We keep track of historical printers but some of them may disappear
forever, say the user changes his printer. In such a case the print
system has no idea that the previous printer will never appear so
this change allows the user to remove historical printers.
In the all printers list the user can now long press on a printer
and if the printer is available he can select it from the context
menu. If the printer was used before regardless if it is active the
user may choose to forget it.
bug:11282742
Change-Id: Idc2dda70920ad045149eea1bcfc75ad1992827e9
Layout and write may take some time during which the user can
cancel printing. Currently we wait for the last operation,
being write or layout, to complete before closing the print
dialog. Now in such a scenario we request a cancellation of
the ongoing operation.
bug:11329523
Change-Id: Ia9d747163cc73509369a86c8b5afc83b7ee54859
1. Implemented the advanced printer options integration. Now a print service
may declare an advanced print options activity which may be launched by
the user if the current printer supports advanced print options. These options
are visible only to the print service that added them and it is the only party
that will interpret the options.
2. Fixed a couple of bugs in the saved print jobs parsing. One was that if there
are more than one page range, a half of the print job properties was not
properly parsed. The other was that the media size constructor was using
incorrect argument order, thus creating a media size with wring width.
3. Fixed and edge case where old print jobs and their docs can get stuck in
the spooler. If the app did not write the requested pages we were not showing
an error message, rather just finish the activity without canceling the print
job and this print job is stuck in the spooler. Now we show an error message
and the user may retry, cancel. If the user cancels the print job is also
cancelled, thus no leftover in the spooler.
4. Fixed the background color of the print dialog to meet UX spec.
bug:11241800
Change-Id: I352440bc86aec824a805883fc9579d96a06d11e6
1. For an app to print it creates a PrintDocumentAdapter implementation
which is passed to the print dialog activity. If the activity that
created the adapter is destroyed then the adapter, which may rely on
the activity state, may be in an invalid state. For example, an app
creates an adapter and calls print resuting in the app activity and
the print dialog activity being stacked. Now the user rotates the
device which triggers the recreating of the activity stack (assume the
app does not handle rotation). The recreated print dialog activity
receives the intent that originally created it with containing the
adapter that was constructed in the context of the old, now destroyed,
app activity instance.
To handle this we are limiting an app to be able to print only from
and activity and when this activity is destroyed we mark the adapter
as invalid which will result in hiding the print dialog activity. Note
that if the app process is killed we already handle this in the print
dialog activiy by registering a death recipient on the adapter binder.
2. In the PrintManager.PrintDocumentAdapterDelegate some of the state is
accessed only on the main thread and some from miltiple threads. The
code was trying to avoid locking for state that is not accessed by
multiple threads but this is error prone and the benefit does not
justify the complexity and added fragility. Now grabbing a lock all
the time.
3. The PrintJobConfigActivity waits for it to bind to the print spooler
service before instantiating its print controller and editor. However,
these can be accessed by invoking some of the activity cycle callbacks.
This change is adding null checks for the case where the activity
callbacks are called before the binding to the spooler is completed.
bug:11242661
Change-Id: Id906b3170e4f0a0553772dfa62686f06fdca0eaf
1. We were using the layout for the printer drop down from the
print dialog as the list item in the all printers activity.
This layout was not high enough. Now we have a separate
layout for the drop down and for the list. Note that they
are almost identical but this is better that writing java
code to lookup the height from the theme and change it
programatically since the java code is almost half the size
of the layout and leads to spreading the logic in both the
layout file and the java code.
2. The padding of the printers list was not correct. Now it
mimics the bahavior in settings where we change the padding
based on orientation.
bug:11261157
Change-Id: I8507c4ee86e9196fe1777cf9577f1886ccfbb1ad
1. There was leftover code in the printers adapter that was
hard coding the item width with no reason to do so.
2. Changed the icon view visibility to invisible to allow
the text of all list items including save to PDF and all
printers to be left aligned.
bug:11225340
Change-Id: I5b51d0d30577699f5cd73c7c58521358653d135b
* commit 'e1b6b6c5816b321864b6a5d72a46860fda8fa7cd':
Bring deleted files from the dead. These files were dropped by the translation pipelines because they do not contain any translated elements, but in reality they are needed.
These files were dropped by the translation
pipelines because they do not contain any
translated elements, but in reality they
are needed.
Bug: 11226380
This is a resource file cotaining the media sizes for the Catalan
locale. Without it the print spooler crashes all the time for that
locale since it cannot construct the PDF printer correctly.
bug:11226380
Change-Id: I7fa9c9bf4ed073e5f4ddf0d0fe9de4998e3467d4