317 Commits

Author SHA1 Message Date
Svetoslav Ganov
d3c197d972 The callbacks for tracking a printer called more than once without printer change.
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
2013-10-12 14:28:47 -07:00
Svetoslav Ganov
7d7888d1c7 Printed document size not persisted.
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
2013-10-12 13:18:16 -07:00
Svetoslav Ganov
9b6d3a153f Fail only scheduled print jobs, i.e. handed to a service, if the service is disabled.
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
2013-10-12 12:35:44 -07:00
Baligh Uddin
ea9aec27cc Merge "Import translations. DO NOT MERGE" into klp-dev 2013-10-12 00:27:15 +00:00
Svetoslav
455e95ebab am 1f5c1f3e: am 036f05b8: Merge "Putting the cursor at the end of the copies and range inputs." into klp-dev
* commit '1f5c1f3eee2df06ae42bc9e2bb9b5502316502cc':
  Putting the cursor at the end of the copies and range inputs.
2013-10-11 17:26:42 -07:00
Svetoslav
1f5c1f3eee am 036f05b8: Merge "Putting the cursor at the end of the copies and range inputs." into klp-dev
* commit '036f05b8b0dabc72e6ce68372516c3d98da137e4':
  Putting the cursor at the end of the copies and range inputs.
2013-10-11 17:22:56 -07:00
Svetoslav
89ed9fcf9b Putting the cursor at the end of the copies and range inputs.
bug:10983508

Change-Id: I767876fada2f28b00283ed9140fca1a40729f38f
2013-10-11 17:04:34 -07:00
Baligh Uddin
b48966885e Import translations. DO NOT MERGE
Change-Id: I11e36ca2c03ecbe1a6c99a8cc4f7e4afed3e5427
Auto-generated-cl: translation import
2013-10-11 16:34:38 -07:00
Baligh Uddin
3532cb4bba Import translations. DO NOT MERGE
Change-Id: I66efc38992968ef463f4d02f1af101053adfb41e
Auto-generated-cl: translation import
2013-10-11 16:31:18 -07:00
Svetoslav
0004010369 am 8e80d1f9: am 33021d95: Merge "Adding timeout if the current printer or its capabilities disappear." into klp-dev
* commit '8e80d1f953932ad867ff4f0b23b466565f1b15f0':
  Adding timeout if the current printer or its capabilities disappear.
2013-10-11 14:36:56 -07:00
Svetoslav
8e80d1f953 am 33021d95: Merge "Adding timeout if the current printer or its capabilities disappear." into klp-dev
* commit '33021d95a8f3ca127c1df6aeb54c3a9219f46093':
  Adding timeout if the current printer or its capabilities disappear.
2013-10-11 14:32:59 -07:00
Svetoslav
02dded1a63 Adding timeout if the current printer or its capabilities disappear.
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
2013-10-11 14:02:49 -07:00
Svetoslav
1d4a8bf4c4 am 6346a928: am c8c943a9: am 3691dd06: Merge "Print spooler not starting." into klp-dev
* commit '6346a9285a3a1a45da4cfda26ea6ed454a87114f':
  Print spooler not starting.
2013-10-11 14:02:49 -07:00
Svetoslav
6346a9285a am c8c943a9: am 3691dd06: Merge "Print spooler not starting." into klp-dev
* commit 'c8c943a93044f63e27b725901568dc62a84606a8':
  Print spooler not starting.
2013-10-11 13:59:39 -07:00
Svetoslav
c8c943a930 am 3691dd06: Merge "Print spooler not starting." into klp-dev
* commit '3691dd063f297162facebf723ac53831126395b5':
  Print spooler not starting.
2013-10-11 13:56:59 -07:00
Svetoslav
54adee86af Print spooler not starting.
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
2013-10-11 12:39:47 -07:00
Svetoslav Ganov
ad9f1cce8c am 0d24a810: am 9ce7ae3e: am f22a767e: Merge "Added UI for errors during layout and write." into klp-dev
* commit '0d24a810d2ab6b5f7092aff3d11442debd78396a':
  Added UI for errors during layout and write.
2013-10-11 10:14:39 -07:00
Svetoslav
a1f9936c6b am 5c880d0d: am 6f688e87: am 8f34715b: Merge "Refactor how the print dialog activity is started." into klp-dev
* commit '5c880d0d1551603dcc4366406ec9ee3b812a8fc4':
  Refactor how the print dialog activity is started.
2013-10-11 10:11:05 -07:00
Svetoslav Ganov
0d24a810d2 am 9ce7ae3e: am f22a767e: Merge "Added UI for errors during layout and write." into klp-dev
* commit '9ce7ae3e2001f378199845d4c14b4304a60b3daf':
  Added UI for errors during layout and write.
2013-10-11 10:09:39 -07:00
Svetoslav Ganov
9ce7ae3e20 am f22a767e: Merge "Added UI for errors during layout and write." into klp-dev
* commit 'f22a767e872ec8f5c2531a88819e0f4574c78fe3':
  Added UI for errors during layout and write.
2013-10-11 10:08:00 -07:00
Svetoslav Ganov
f22a767e87 Merge "Added UI for errors during layout and write." into klp-dev 2013-10-11 17:06:12 +00:00
Svetoslav
5c880d0d15 am 6f688e87: am 8f34715b: Merge "Refactor how the print dialog activity is started." into klp-dev
* commit '6f688e879a2523393e8e0da072e1f62cb456276f':
  Refactor how the print dialog activity is started.
2013-10-11 10:06:03 -07:00
Svetoslav
6f688e879a am 8f34715b: Merge "Refactor how the print dialog activity is started." into klp-dev
* commit '8f34715b94a1733f4cc5f31426d5dafcd57052c7':
  Refactor how the print dialog activity is started.
2013-10-11 10:04:27 -07:00
Svetoslav Ganov
caff38821a Added UI for errors during layout and write.
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
2013-10-11 10:04:02 -07:00
Svetoslav
8f34715b94 Merge "Refactor how the print dialog activity is started." into klp-dev 2013-10-11 17:01:15 +00:00
Svetoslav
7bfbbcb04b Refactor how the print dialog activity is started.
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
2013-10-11 09:11:24 -07:00
Baligh Uddin
260c29d0f0 Merge "Import translations. DO NOT MERGE" 2013-10-11 15:08:35 +00:00
Baligh Uddin
576124688b Merge "Import translations. DO NOT MERGE" into klp-ub-dev 2013-10-11 15:08:29 +00:00
Baligh Uddin
d32e9b7ffb Merge "Import translations. DO NOT MERGE" into klp-dev 2013-10-11 15:08:10 +00:00
Svetoslav
d1810e3931 am 9b74a780: am 5b8f01b6: am 466c046f: Merge "Fixing jank when transition from print dialog to generating one." into klp-dev
* commit '9b74a78063707c45ffd1a173de51e215fd7e53b4':
  Fixing jank when transition from print dialog to generating one.
2013-10-10 19:27:00 -07:00
Svetoslav
518fb915d2 resolved conflicts for merge of 93e12a7c to master
Change-Id: I94b488bdfce77c5f0708f5ccdced6800aa939785
2013-10-10 19:24:32 -07:00
Svetoslav
9b74a78063 am 5b8f01b6: am 466c046f: Merge "Fixing jank when transition from print dialog to generating one." into klp-dev
* commit '5b8f01b62a09b001da4959d367fa99e46143791b':
  Fixing jank when transition from print dialog to generating one.
2013-10-10 19:21:03 -07:00
Svetoslav
93e12a7c25 resolved conflicts for merge of 92aa5f4e to klp-dev-plus-aosp
Change-Id: Ib2a3bd688256cb2e6bed13ebac01a31bd2601788
2013-10-10 19:17:27 -07:00
Svetoslav
5b8f01b62a am 466c046f: Merge "Fixing jank when transition from print dialog to generating one." into klp-dev
* commit '466c046f204e98b44506dfb1718f0b56094486f7':
  Fixing jank when transition from print dialog to generating one.
2013-10-10 18:44:22 -07:00
Svetoslav
466c046f20 Merge "Fixing jank when transition from print dialog to generating one." into klp-dev 2013-10-11 01:39:09 +00:00
Baligh Uddin
5239b89ac6 Import translations. DO NOT MERGE
Change-Id: I05a9b361d37d6ec99db7218cb091847ebfb3383b
Auto-generated-cl: translation import
2013-10-10 17:49:39 -07:00
Baligh Uddin
9a9eef2894 Import translations. DO NOT MERGE
Change-Id: I23fe12c08af8ee2eeaf1e6d92a1f8c2ccb69a74e
Auto-generated-cl: translation import
2013-10-10 17:48:26 -07:00
Baligh Uddin
454d33ad89 Import translations. DO NOT MERGE
Change-Id: I902ff15c7df70eef8986dc2dcfbac59551f085fa
Auto-generated-cl: translation import
2013-10-10 17:47:20 -07:00
Svetoslav Ganov
92aa5f4ed2 am 896a9b17: Merge "Adding missing resourcs for the defaul PDF printer media sizes." into klp-dev
* commit '896a9b172627ec318f908e734941afb06cc68169':
  Adding missing resourcs for the defaul PDF printer media sizes.
2013-10-10 16:55:15 -07:00
Svetoslav
3aa2e2b3ab Fixing jank when transition from print dialog to generating one.
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
2013-10-10 16:52:54 -07:00
Svetoslav Ganov
896a9b1726 Merge "Adding missing resourcs for the defaul PDF printer media sizes." into klp-dev 2013-10-10 23:52:07 +00:00
Svetoslav
58724ac0f3 am 0c6b23ae: am 4208b408: am 6f71ed5b: Merge "Sometimes the print button not enabled and an accessibility fix." into klp-dev
* commit '0c6b23ae95bb9490df2995d3f4a29636eaa5cc7e':
  Sometimes the print button not enabled and an accessibility fix.
2013-10-10 10:21:02 -07:00
Svetoslav Ganov
4071e05b29 am 0a41b054: am bf74156f: am 0ea16e9e: Merge "Coalescing multiple print job notifications." into klp-dev
* commit '0a41b0547b5851121fdc833e08dccf665112fc00':
  Coalescing multiple print job notifications.
2013-10-10 10:20:58 -07:00
Svetoslav
0c6b23ae95 am 4208b408: am 6f71ed5b: Merge "Sometimes the print button not enabled and an accessibility fix." into klp-dev
* commit '4208b4088b9a677f62c635f2661c246f626f7928':
  Sometimes the print button not enabled and an accessibility fix.
2013-10-10 10:17:44 -07:00
Svetoslav Ganov
0a41b0547b am bf74156f: am 0ea16e9e: Merge "Coalescing multiple print job notifications." into klp-dev
* commit 'bf74156f59013dc5c284c224f14a382f813e8825':
  Coalescing multiple print job notifications.
2013-10-10 10:17:40 -07:00
Svetoslav
4208b4088b am 6f71ed5b: Merge "Sometimes the print button not enabled and an accessibility fix." into klp-dev
* commit '6f71ed5b58a9bcf23fd252d13cc4206d38921960':
  Sometimes the print button not enabled and an accessibility fix.
2013-10-10 10:14:26 -07:00
Svetoslav Ganov
bf74156f59 am 0ea16e9e: Merge "Coalescing multiple print job notifications." into klp-dev
* commit '0ea16e9e763b5815707971f503d5408dc1b66c10':
  Coalescing multiple print job notifications.
2013-10-10 10:14:23 -07:00
Svetoslav Ganov
4ba9254824 Adding missing resourcs for the defaul PDF printer media sizes.
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
2013-10-10 00:52:42 -07:00
Svetoslav
ebec46847d Sometimes the print button not enabled and an accessibility fix.
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
2013-10-10 07:33:02 +00:00
Svetoslav Ganov
a18661d592 Coalescing multiple print job notifications.
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
2013-10-09 23:43:11 -07:00