320 Commits

Author SHA1 Message Date
Svetoslav Ganov
2b40c83ae1 Deleting print job files when we do not have to.
The print job file name was not properly parsed. This resulted
in incorrect mapping from file to print job, thus deleting the
file when we do not have to.

bug:11069354

Change-Id: I7b8a7a7f98dd77b34119f2a9cd16a6ec3c22b63b
2013-10-04 08:49:32 -07:00
Baligh Uddin
0a6db6691b Merge "Import translations. DO NOT MERGE" 2013-10-03 03:41:01 +00:00
Baligh Uddin
a6b90f39f1 Merge "Import translations. DO NOT MERGE" into klp-dev 2013-10-03 03:40:55 +00:00
Svetoslav
39e71de6b4 Print UI tweaks as per UX request.
1. Limit the width of the dropdown of the printers list.

2. Add icons the the list in the all pritners activity.

3. Update the empty state view for the all printers activity.

bug:10983508

Change-Id: I19effcf32770fdda278009a060b5170a3f29988e
2013-10-02 19:30:43 -07:00
Svetoslav
b0c0c88e79 am 7132b9b8: am 57344fea: am 913f87ef: Merge "IndexOutOfBoundsException in the PrintSpoolerService dump." into klp-dev
* commit '7132b9b88aad250ab59e6cfd5a3d30b6db2a3cf2':
  IndexOutOfBoundsException in the PrintSpoolerService dump.
2013-10-02 15:08:57 -07:00
Svetoslav
7132b9b88a am 57344fea: am 913f87ef: Merge "IndexOutOfBoundsException in the PrintSpoolerService dump." into klp-dev
* commit '57344fea1cba51c179dd153ba60f87391595fec8':
  IndexOutOfBoundsException in the PrintSpoolerService dump.
2013-10-02 15:06:11 -07:00
Svetoslav
57344fea1c am 913f87ef: Merge "IndexOutOfBoundsException in the PrintSpoolerService dump." into klp-dev
* commit '913f87ef637fc1d9a006c543833b6815090b94e8':
  IndexOutOfBoundsException in the PrintSpoolerService dump.
2013-10-02 15:02:44 -07:00
Svetoslav
913f87ef63 Merge "IndexOutOfBoundsException in the PrintSpoolerService dump." into klp-dev 2013-10-02 22:00:50 +00:00
Svetoslav
b67a637e60 IndexOutOfBoundsException in the PrintSpoolerService dump.
The dump code in PrintSpoolerService was relying on being
called only as a result of "adb shell dumpsys print" which
is apparently wrong. As a result the code was making wrong
assumption about the input arguments.

bug:11046234

Change-Id: Ie38f3cc5f17cac98b808fef6d6bbeaca22a62ef0
2013-10-02 12:40:18 -07:00
Svetoslav
cea40b25bd am 7f0e8be0: am c114e19c: am 228a7d2a: Merge "Sometimes printer selection from all printers activity does not work." into klp-dev
* commit '7f0e8be082590dadb8606f71f4b9b28b88851360':
  Sometimes printer selection from all printers activity does not work.
2013-10-02 12:23:12 -07:00
Svetoslav
7f0e8be082 am c114e19c: am 228a7d2a: Merge "Sometimes printer selection from all printers activity does not work." into klp-dev
* commit 'c114e19c10a7485d8b7c10c94a268a2703b29217':
  Sometimes printer selection from all printers activity does not work.
2013-10-02 12:19:41 -07:00
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