309 Commits

Author SHA1 Message Date
Svetoslav
c114e19c10 am 228a7d2a: Merge "Sometimes printer selection from all printers activity does not work." into klp-dev
* commit '228a7d2a157c4e6ceee5fdea389f207bbf4990ba':
  Sometimes printer selection from all printers activity does not work.
2013-10-02 12:17:54 -07:00
Svetoslav
228a7d2a15 Merge "Sometimes printer selection from all printers activity does not work." into klp-dev 2013-10-02 19:15:10 +00:00
Baligh Uddin
17e98098af Import translations. DO NOT MERGE
Change-Id: I4380f0069eaef0df57367ada16caa152ff939f55
Auto-generated-cl: translation import
2013-10-02 11:14:12 -07:00
Baligh Uddin
82b8c8c73c Import translations. DO NOT MERGE
Change-Id: I4aa7e1ed8ccce520518231a116608bc8e013bb4c
Auto-generated-cl: translation import
2013-10-02 11:12:53 -07:00
Svetoslav
abfe8d2046 am f7851e3f: am 2f5440bd: am cbf3f2cd: Merge "Adding an empty state UI for the printer search activity in the spooler." into klp-dev
* commit 'f7851e3f80b724ac65c589985b81e0a89a54bae0':
  Adding an empty state UI for the printer search activity in the spooler.
2013-10-02 09:44:27 -07:00
Svetoslav
f7851e3f80 am 2f5440bd: am cbf3f2cd: Merge "Adding an empty state UI for the printer search activity in the spooler." into klp-dev
* commit '2f5440bd3bfbd102051928b9e38711ffb3ad59fe':
  Adding an empty state UI for the printer search activity in the spooler.
2013-10-02 09:37:18 -07:00
Svetoslav
2f5440bd3b am cbf3f2cd: Merge "Adding an empty state UI for the printer search activity in the spooler." into klp-dev
* commit 'cbf3f2cde569aac3a49d888d2bd52d77dc139738':
  Adding an empty state UI for the printer search activity in the spooler.
2013-10-01 19:24:31 -07:00
Svetoslav
4e4874bb71 Sometimes printer selection from all printers activity does not work.
1. Sometimes selecting a printer from the full printer list does not
   work if the selected printer was not in the initial drop down list
   of the print dialog.

   The reason was that there is a race. We use loaders in the print
   dialog activity and the all printers one. When these loaders are
   stopped we stop printer discovery since we do not want to keep this
   potentially expensive process on going if the activity is paused
   because say the user decide to press home and start playing his
   favorite game while the printers dialog is up. As a result the
   loader does not get printer updates until it is started.

   The loader of the print dialog activity is stopped while the user is
   selecting a printer from the all printers activity whose loader is
   getting discovered recent printers. Now when the user selects a printer
   the loader of the print dialog activity is started but may not get
   the latest printers by the time onActivityResult is called with the
   selected printer. Now we cache the selected printer id and if the
   loader reports it we select that printer.

2. In the print dialog we show only a few of the discovered printers.
   If the user selects a printer from the all printers activity that
   is not in the initial list we shuffle the adapter data to make sure
   the selected printer is in the shown subset. Now if the printers
   change, i.e. the printers loader reports new result we were not
   respecting the reshuffling made before so the short list of
   printers changes yet again.

bug:11034216

Change-Id: I54fe3619e3328b65839d9f4b02309699eae7f8eb
2013-10-01 19:12:27 -07:00
Svetoslav
a4e395057f am c6568719: Merge "Ignore historical printer records for installed services" into klp-dev
* commit 'c6568719671206e726f260fad390680f7fb0ee9e':
  Ignore historical printer records for installed services
2013-10-01 18:44:25 -07:00
Svetoslav
976b4e6312 Adding an empty state UI for the printer search activity in the spooler.
The user can select all printers from the print dropdown to get to
a search for printers activity where one can filter out the list
of a available printers. We did not have an empty state UI for the
case when the query yields no printers.

bug:11009053

Change-Id: I6b45517b8a7b319992019a1bf65858319a19a0de
2013-10-01 15:32:57 -07:00
Svetoslav Ganov
ce5cb02eca 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 19:46:15 -07:00
Baligh Uddin
d04f0265a4 Merge "Import translations. DO NOT MERGE" 2013-10-01 02:40:25 +00:00
Svetoslav
82d2d7e4b0 am c6568719: Merge "Ignore historical printer records for installed services" into klp-dev
* commit 'c6568719671206e726f260fad390680f7fb0ee9e':
  Ignore historical printer records for installed services
2013-09-30 17:10:21 -07:00
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