When the user selectes a printer in the UI we ask the print service to start tracking
the printer, i.e. to observe changes of the printer state and capabilities. The callback
for the initially selected printer is called twice which breaks the contract and also
may trigger potentially expensive operations on the print service side.
More precisely the printer does not change and we ask the service to start tracking,
stop tracking, and again start tracking.
bug:11199851
Change-Id: Ib761e6da03f670b3098c69b1c0927177a8e4ae6b
We persist ongoing print jobs so they can be restarted if the device
dies. The data size of the printed document was not persisted to disc.
bug:11199352
Change-Id: I53ef1ee285aa4808917dd6a5c7335226aba1ef0a
When a print service is disabled we assume all print jobs for it failed as we have
no way to know what happens to them. However we are also failing created print jobs,
i.e. ones not given to the service. Such jobs are in process of construction and
the print dialog is up. We should not fail such jobs as the dialog can still modify
their state and potentially select a print from a different service. Therefore, we
leave them alone and they will be failed if when constructed are passed to a
disabled/uninstalled service.
bug:11197432
Change-Id: Ie4fe54327e3e25776b1dd572be2dfafdd700c2e5
If the current printer becomes unavailable or its capabilities
go away we are scheduling a timeout to declare the printer as
unavailable.
bug:10983508
Change-Id: Iab85cfd35fc0cecc3dd4abac6232347f9da18fb0
1. In my previous change I fixed a typo in the Java constant with
intent action to launch the print dialog but failed to updated
the print spooler manifest.
2. Removed dead code - the user id is no longer needed since the
spooler is an app that runs per user. Every user has its spooler.
This code was not referenced from anywhere.
3. Added a default icon to the print spooler.
4. Fixed a bug where if the print history is empty the UI goes
to the all pritners activity.
bug:11059554
Change-Id: If74c23b418a8c67620ba14435ee7f3b2c4527099
1. If an error happens during layout or write we show an error
message with the string provided by the application which
has an OK button to retry or tap outside to cancel.
2. Updated the targed and min SDK version for the PrintSpooler.
bug:11127269
Change-Id: I4301cf3716119b1e33b95347a8451fc1c128343b
1. Before the print job activity was started asyncronously with
respect to the print call on to the print manager. This was
creating a situation where the starting activity may finish
before the print dialog appears which may lead to an orphaned
print document adapter with no data to print (as the UI is
is gone), or strange behaviors where the print dialog starts
on as a separate task.
To address this the pending intent for starting the print
dialog is not started by the print spooler since we cannot
call into it synchronously as we have to start its process
and bind to the spooler service which leads to jankyness in
the client app. Now the pending intent is created by the
print manager service in the synchronous print call so
from an app's perspective calling print starts the activity.
The side effect of this design is that the print dialog
activity may start before the system is bound to the spooler
service. In such a case the print activity cannot start
poking the print spooler state as the system registers
callback to observe the spooler state. To address this
the print spooler activity disables the UI and also binds
to the spooler service which happenes immediately after it
is started. As soon as the print dialog binds to the
service it starts the UI.
2. Fixed an bug in the printer adapter of the print dialog that
was leading to a crash if the only item in the adater is the
all pritners option and it is selected.
3. Piping the package name that started the printing so we can
pass it to the storage UI as a hint to open the last location
the app used.
bug:11127269
Change-Id: Ia93820bdae0b0e7600a0930b1f10d9708bd86b68
Initially we show the print dialog and when the user presses print
we show a generating dialog with an indefinite spinner and a cancel
button. The transition between the two UIs which are really different
layouts show in the print activity is animated. In the middle of
the animation from print to generating UI there was a jump of the
content and an undesired window animation kicking in. This is a
side effect of changing the activity to floating so now changing the
container size was causing window resize and hence animation. Fun!
bug:10983508
Change-Id: I7d88e073c55863b945cdb50822401592f32d44c3
Some regions have different media size standards and the fake PDF
printer shows the media sizes for the current locale. Interestingly,
these files were skipped in my previous change while I remember
adding them - maybe did not upload the patch.
bug:11147920
Change-Id: I819ab08fbef08305be89e3acf297328b1a0ded11
1. Sometimes the print button is not enabled after selecting a printer
from the all printers activity. This was happening after a printer
was selected, we had to do a layout due to changed print attributes
(because of the new printer's capabilities), and the content did not
change. In this case we did not call the updateUi function which
enables the print button after layout is completed.
2. The accessibility code in the all printers activity was not checking
whether accessibility is on and doing some unnecessary work - not sending
events though but still. Further, the delayed runnable that was
doing the accessibilty announcements was not removed when the activity
was paused.
bug:10983508
Change-Id: Ib263116a3e21e4c75a25aa051cecbd9194417319
1. We used to show a single notificaiton for every print job but
this is against th UX guidelines. Since we have to lead by
example, this change adds coalescing of multiple notifications.
bug:11155212
2. Print job state callback in the PrintManager now correctly
invoked on the main thread.
bug:10983508
Change-Id: I906e9e62198fa37cb4d2f71fce07ed475d61e1bd