296 Commits

Author SHA1 Message Date
Svetoslav Ganov
b84aa9fee3 am b415525a: Merge "Print job files and print job records not always cleaned up." into klp-dev
* commit 'b415525a16074b6dc8e295655648b7c7c1074bbb':
  Print job files and print job records not always cleaned up.
2013-09-30 17:10:08 -07:00
Svetoslav Ganov
fb83af78fa am c783f673: Merge "Adding a timeout for waiting to get the selected printer\'s capabilities." into klp-dev
* commit 'c783f6738f0f6d2cb57702cfbc9219c59a3410a3':
  Adding a timeout for waiting to get the selected printer's capabilities.
2013-09-30 17:09:51 -07:00
Svetoslav
049e69070a am 25b0151a: Merge "Printers in the list of printers change position." into klp-dev
* commit '25b0151a570ff6fb7a6acd9c788b9c3cc9f76be9':
  Printers in the list of printers change position.
2013-09-30 17:07:13 -07:00
Baligh Uddin
b1310d4e28 Import translations. DO NOT MERGE
Change-Id: Ia050326f182c55e8954f73e33d36d96ed575497b
Auto-generated-cl: translation import
2013-09-30 09:30:06 -07:00
Baligh Uddin
dd4ce7119f Import translations. DO NOT MERGE
Change-Id: Ie40b704529f71e71f5c384450a79923c68354bb9
Auto-generated-cl: translation import
2013-09-30 09:28:55 -07:00
Svetoslav
d8dbc13b47 Ignore historical printer records for installed services
When loading historical records for previously used printers we
now ignore the ones whose target print service is not installed.

bug:10955652

Change-Id: Ib295e7d88ed3c308ef6d8a11bdc1792ebbb6d526
2013-09-27 18:46:24 -07:00
Svetoslav Ganov
b415525a16 Merge "Print job files and print job records not always cleaned up." into klp-dev 2013-09-28 01:06:51 +00:00
Svetoslav Ganov
c783f6738f Merge "Adding a timeout for waiting to get the selected printer's capabilities." into klp-dev 2013-09-28 00:28:08 +00:00
Svetoslav Ganov
dd68da2741 Print job files and print job records not always cleaned up.
1. We want the files for a print job to be removed as early as possible
   typically because the print job was cancelled, completed, the app
   or the spooler crashed during print job construction. We were keeping
   around in the spooler and hence to disc infos for jobs that are in
   final state since the app that created them may hold a reference to
   a local print job objec whose info it can access to get the latest
   print job state potentially after the job reached final state. The
   issue was that we were persisting to disc created print jobs which
   were during construction which requires careful handling for the
   various cases above. This is tricky and error prone.

   We used to tell the spooler to forget the print jobs infos when the
   app that created them died. The implementation to forget a print
   job was not careful and was nuking currently running print jobs in
   addition to the ones in a terminal state. Further, if the app dies
   before a print job is completed we were left with a stale print
   job in the spooler since we missed the signal to forget it (assuming
   we forget only inactive jobs). These issues suggest that the approach
   is problematic.

   Now we have a cache of print job infos for the jobs an app created.
   This cache is updated when the state of a print jobs changes using
   the new print job state observation code. When the app dies we
   remove the cached jobs for that app. Now if the app calls to get
   the print jobs it gets the cached ones, i.e. the print jobs it
   created during its lifetime, plus the print jobs that are still
   active fetched from the spooler. Note that transient state cannot
   be kept in the spooler since we unbind from it if there is no
   work and it may get killed.

2. Improved the print sub-system logging code to show the cached
   print job infos for apps and also dump the print job PDF file
   names.

bug:10958357

Change-Id: I6f7c1968b6b7ba5be182a10df044ff7ea1fc3a61
2013-09-27 17:26:44 -07:00
Svetoslav Ganov
6be4c76441 Adding a timeout for waiting to get the selected printer's capabilities.
A print service may choose to provide only the printer info and then when
it is requested to start tracking the state of the printer, the service
should provide the printer capabilities. If the capabilities are not
received within ten seconds we mark the printer as unavailable and stop
tracking it.

bug:10748639

Change-Id: I9171cb5dc116fd321c23a8e4ab55109448e2fc6a
2013-09-27 09:43:32 -07:00
Svetoslav
c335eb4115 Printers in the list of printers change position.
1. The printers in the printers list of settings change position if
   they are updated. The settings app is using hidden platform APIs
   the this change fixes.

2. Enable ProGuard for the PrintSpooler.

3. Added icons on the list of printers so the user knows which
   print service used the printer. Now the user can know when
   he is using cloud print and maybe incurring data costs vs
   local printer discovered by a vendor plug in.

bug:10955751

Change-Id: I292f48b424cb561218fdb424d0388f4d786d8339
2013-09-26 18:49:10 -07:00
Svetoslav Ganov
dd812e0c97 am 342daca7: am 2c854022: Merge "Choosing default paper size for the "Save to PDF" fake printer" into klp-dev
* commit '342daca7d7407fbe07df571a4c0ba6a51a89e15d':
  Choosing default paper size for the "Save to PDF" fake printer
2013-09-26 14:18:13 -07:00
Svetoslav Ganov
342daca7d7 am 2c854022: Merge "Choosing default paper size for the "Save to PDF" fake printer" into klp-dev
* commit '2c854022bf7fb6d626b0e86dc0c16372774f2432':
  Choosing default paper size for the "Save to PDF" fake printer
2013-09-26 14:14:49 -07:00
Svetoslav Ganov
0ce3e8743c Choosing default paper size for the "Save to PDF" fake printer
Change-Id: I1e2eb73fd1eb3b1e9812155b69b94cba261243c2
2013-09-26 13:54:49 -07:00
Svetoslav Ganov
af1066d917 am 4609d9a9: am 5cab967b: Merge "Adding hidden APIs for observing the print jobs state." into klp-dev
* commit '4609d9a9ebc17d804d31d5241968157439c92a57':
  Adding hidden APIs for observing the print jobs state.
2013-09-26 12:28:59 -07:00
Svetoslav Ganov
aa14d0e7fd am 1711895e: am 3adc49c6: Merge "Disallow range selection if the document has unknown page count." into klp-dev
* commit '1711895e7a36956e68dd520109672e34a5baa159':
  Disallow range selection if the document has unknown page count.
2013-09-26 12:28:56 -07:00
Svetoslav Ganov
7d877d9c58 am d5159505: am c9cfd605: Merge "Missed signal in FusedPrintersLoader." into klp-dev
* commit 'd5159505638b2ff29de755231cc7139a3daeca4a':
  Missed signal in FusedPrintersLoader.
2013-09-26 12:25:20 -07:00
Svetoslav Ganov
f2e730589f am c2999acd: am 027ff385: Merge "Page range validation edge case handling." into klp-dev
* commit 'c2999acd6105e2918285ebf16430e23507a84255':
  Page range validation edge case handling.
2013-09-26 12:25:16 -07:00
Svetoslav Ganov
4609d9a9eb am 5cab967b: Merge "Adding hidden APIs for observing the print jobs state." into klp-dev
* commit '5cab967bf2bab49777bfa86dff8b0f892192ede6':
  Adding hidden APIs for observing the print jobs state.
2013-09-26 12:25:10 -07:00
Svetoslav Ganov
1711895e7a am 3adc49c6: Merge "Disallow range selection if the document has unknown page count." into klp-dev
* commit '3adc49c6780633b8bccc3b5b8dca10788c2288bc':
  Disallow range selection if the document has unknown page count.
2013-09-26 12:25:07 -07:00
Svetoslav Ganov
5cab967bf2 Merge "Adding hidden APIs for observing the print jobs state." into klp-dev 2013-09-26 19:22:20 +00:00
Svetoslav Ganov
d515950563 am c9cfd605: Merge "Missed signal in FusedPrintersLoader." into klp-dev
* commit 'c9cfd605a24cf20df5248d73804c584168db64c9':
  Missed signal in FusedPrintersLoader.
2013-09-26 12:21:30 -07:00
Svetoslav Ganov
c2999acd61 am 027ff385: Merge "Page range validation edge case handling." into klp-dev
* commit '027ff3855d257e5179d43a1859bf56530d0f975a':
  Page range validation edge case handling.
2013-09-26 12:21:27 -07:00
Svetoslav Ganov
3adc49c678 Merge "Disallow range selection if the document has unknown page count." into klp-dev 2013-09-26 19:21:06 +00:00
Svetoslav Ganov
c9cfd605a2 Merge "Missed signal in FusedPrintersLoader." into klp-dev 2013-09-26 19:20:28 +00:00
Svetoslav Ganov
027ff3855d Merge "Page range validation edge case handling." into klp-dev 2013-09-26 19:19:39 +00:00
Svetoslav Ganov
953c4143e8 Missed signal in FusedPrintersLoader.
1. In the FusedPrintersLoader we start observing the printers on
   the device and if they change we send the result. If however,
   the printers are already loaded in our session (because it
   joined an ongoing printer discovery) and the pritners do not
   change, the loader never sends its result. Now we are registring
   the callback only after historical printers are loaded. We
   also immediately check after starting discovery whether the
   there are printers in the discovery session and if so deliver
   them.

2. Improved logging in the FusedPrintersLoader.

bug:10940712

Change-Id: Ieb9b897d64780742125b29309462dea3eda170a6
2013-09-26 08:14:27 -07:00
Svetoslav Ganov
ab051baea5 Page range validation edge case handling.
The regular expression for validating range input was missing a
coupe of edge cases.

bug:10906805

Change-Id: Ie793588ecb6697aff3d8d85124a8faeda58c69e5
2013-09-26 00:35:04 -07:00
Svetoslav Ganov
b0e68fdc9c Disallow range selection if the document has unknown page count.
bug:10741878

Change-Id: Ibf2272125e81f14ede3fdfec86aee10b908ade01
2013-09-25 18:32:25 -07:00
Svetoslav Ganov
704697b619 Adding hidden APIs for observing the print jobs state.
This is needed for implementing the print job settigns UI.

bug:10935736

Change-Id: I63b42cbf4ce6a259fa1af47fa368b148ca5621c1
2013-09-25 17:57:07 -07:00
Baligh Uddin
bef7ffafb5 Import translations. DO NOT MERGE
Change-Id: I43ea4f6dcef11d0fa62c8f329b39c0ea49be2439
Auto-generated-cl: translation import
2013-09-25 16:34:46 -07:00
Baligh Uddin
df79953527 Import translations. DO NOT MERGE
Change-Id: I4842b7afb76ee393c19a39d0818f3f2066616803
Auto-generated-cl: translation import
2013-09-25 16:33:59 -07:00
Baligh Uddin
46485d6df6 Import translations. DO NOT MERGE
Change-Id: Id5391f651538cc46ad7455dedaa3426e29efc9c9
Auto-generated-cl: translation import
2013-09-25 08:42:54 -07:00
Svetoslav
62034df44d am de31fbe0: am b55afe8b: Merge "User should not be able to select unavailable printers." into klp-dev
* commit 'de31fbe04a75d9a8c3c163fbebeacd052ce54e72':
  User should not be able to select unavailable printers.
2013-09-24 16:21:31 -07:00
Svetoslav
de31fbe04a am b55afe8b: Merge "User should not be able to select unavailable printers." into klp-dev
* commit 'b55afe8b835da2d0ebe596877bf93076e4726724':
  User should not be able to select unavailable printers.
2013-09-24 16:17:43 -07:00
Svetoslav
2a708617df User should not be able to select unavailable printers.
1. If the printer is unavailable we should not allow the user
   to select it. Rather, show it grayed out.

2. Some string changes requeted by translators.

bug:10917222

Change-Id: I370f05f9c8e70e3f077db7eb02cf48e19a59925d
2013-09-24 15:46:17 -07:00
Svetoslav
8e137b53b9 am d454beb8: am 0d38d0b4: Merge "Multiple printer discovery session instances and other bugs." into klp-dev
* commit 'd454beb8545e9427eaeb5eb757badbe6907cf6a2':
  Multiple printer discovery session instances and other bugs.
2013-09-24 13:41:47 -07:00
Svetoslav
d454beb854 am 0d38d0b4: Merge "Multiple printer discovery session instances and other bugs." into klp-dev
* commit '0d38d0b42fba7dc50454d5c0652cf351c58a9db6':
  Multiple printer discovery session instances and other bugs.
2013-09-24 13:40:02 -07:00
Svetoslav
0d38d0b42f Merge "Multiple printer discovery session instances and other bugs." into klp-dev 2013-09-24 20:37:59 +00:00
Svetoslav Ganov
3e65abdf26 am 5bf43d25: am 5dfccc3c: Merge "The current is printer not refreshed when selected." into klp-dev
* commit '5bf43d253c13cb18c9026cde147b10fc5676b1c4':
  The current is printer not refreshed when selected.
2013-09-24 10:23:05 -07:00
Baligh Uddin
e0a2e43a13 Merge "Import translations. DO NOT MERGE" 2013-09-24 14:58:12 +00:00
Baligh Uddin
87ac87a5e5 Merge "Import translations. DO NOT MERGE" into klp-dev 2013-09-24 14:58:07 +00:00
Svetoslav
b5f180608d Multiple printer discovery session instances and other bugs.
1. The fused printers provider was dropping on the floor received printers
    if it was not active. It is in fact a loaded and if not active it should compute
    the printers and not deliver them until activated. This fixes an issue where
    opening the print dialog, then enabling a print service results in the printers
    reported by the service not showing up in the print dialog.

2. Printer discovery session was created twice which leads to incorrect behavior
    as the pint system is designed around the contract that there is a single
    printer discovery session per service at a time. This was possible due to an
    incorrect initialization of a member variable resulting in double session creation
    when the print service is connected.

3. When a print service is enabled during discovery we did not use the correct
    condition to start printer discovery resulting in starting it all the time even if
    not needed. Also if some of the printers that had to be tracked are reported
    by the service just enabled (typically historical printers) we did not ask the
    service to start tracking them.

4. Removed some logging.

bug:10903343

Change-Id: I46c049471a4b099fc668df3aee2aaedc8d7786ac
2013-09-23 23:41:12 -07:00
Svetoslav Ganov
5dfccc3c0d Merge "The current is printer not refreshed when selected." into klp-dev 2013-09-23 23:04:32 +00:00
Svetoslav Ganov
307a0d4db2 The current is printer not refreshed when selected.
Every time a printer is selected we have to refresh it by telling
the print service to stop tracking the previously selected printer
if such and start tracking the current one. As a result of start
tracking the print service has to give us the capabilities too. A
previous patch caused a regression and we do not refresh printers
when needed.

bug:10898968

Change-Id: I9d5413e324fdb8856ef61849d36a161470eb204d
2013-09-23 15:51:06 -07:00
Baligh Uddin
8a72458461 Import translations. DO NOT MERGE
Change-Id: I26e4d60d81e13181feeb872b09db4c242105e34e
Auto-generated-cl: translation import
2013-09-23 09:11:15 -07:00
Baligh Uddin
e209e27112 Import translations. DO NOT MERGE
Change-Id: Ia5c6ae14529080f176a14f5b8b2307cc2aa39fed
Auto-generated-cl: translation import
2013-09-23 09:10:23 -07:00
Svetoslav
a4f6409c97 Page ranges not correct in come cases.
1. The algorithm that determines whether a page range contains
   another one had a bug and in some cases misbehaved.

2. When print is pressed we do a final layout and if nothing
   changes and we have the requeted pages we skip the final
   write. However, in this case we did not update the print
   job with the pages to be printed but we have to since in
   the previous write we did not ask for all selected pages,
   rather for the first one to be shown as a preview. Now if
   we have all pages and nothing changed we update the print
   job pages.

bug:10530142

Change-Id: I10fb62ae5ae07b8e54d547fd4dca555a12451bc5
2013-09-21 11:25:36 -07:00
Svetoslav
b39ce63d28 Merge "Offer to enable a print service after it is installed." into klp-dev 2013-09-21 01:15:47 +00:00
Svetoslav
d8f391b4e0 Offer to enable a print service after it is installed.
The user has to explicitly enable a print service from the settings UI
before using it. Usually, users very rarely if at all interact with print
services, therefore all print service management task are performed from
the print settings. We also have to get user consent warning that the
user's data is about to be given to a third-party app. We now post a
notification allowing the user to go directly to the settings screen to
turn the service on.

bug:10447510

Change-Id: Iea56c0825f0bf38328ad94912f0ea5576e9339b3
2013-09-20 17:40:25 -07:00