508 Commits

Author SHA1 Message Date
Svetoslav
fcecdccc0f am 369f1ec6: Merge "Add a missing file to print spooler resources" into lmp-mr1-dev
* commit '369f1ec6ea78637870f35822456628e7ae8caf95':
  Add a missing file to print spooler resources
2015-01-27 04:26:55 +00:00
Svetoslav
c0198ce12e Add a missing file to print spooler resources
bug:19120603

Change-Id: Id33c77696a47ef48b0095fd8289f92d7bba71f19
2015-01-23 17:50:31 -08:00
Svetoslav
5303451efc am 4667d247: Merge "Inconsistent media sizes for es-US locale." into lmp-mr1-dev
* commit '4667d247bbff30d7fe47a4022b91eb03da17be4d':
  Inconsistent media sizes for es-US locale.
2014-12-03 17:19:29 +00:00
Svetoslav
4667d247bb Merge "Inconsistent media sizes for es-US locale." into lmp-mr1-dev 2014-12-03 16:34:00 +00:00
Svetoslav
95482c28f5 am cdd3356d: Merge "Allow more space for the printer spinner to avoid truncation." into lmp-mr1-dev
* commit 'cdd3356da9386bff842d9a29fad09a1d5edc1e73':
  Allow more space for the printer spinner to avoid truncation.
2014-12-02 23:23:40 +00:00
Svetoslav
cdd3356da9 Merge "Allow more space for the printer spinner to avoid truncation." into lmp-mr1-dev 2014-12-02 23:16:38 +00:00
Svetoslav
a1ec54b454 Inconsistent media sizes for es-US locale.
The pdf_printer_media_sizes array for es-US was missing
resulting in using European paper sizes for US locale and
as a result no default media size for this locale. This
resulted in printing not working for es-US.

bug:18536264

Change-Id: Ied552a63d628be38dc5249f3cd6107cbeaa692a8
2014-12-02 15:09:59 -08:00
Baligh Uddin
864eedc401 Import translations. DO NOT MERGE
Change-Id: I1fa46bb80033e1eee5de30cbf0d0d5d07ae4147c
Auto-generated-cl: translation import
2014-12-02 14:07:25 -08:00
Svetoslav
94ef9e6bc8 Allow more space for the printer spinner to avoid truncation.
The save to PDF option is truncated in Russian. While the printer
name can be arbitrarily long, the Save to PDF printer should not
be truncated.

bug:18546218

Change-Id: Id35bd638c505783a2288c1602960e8d74ec3b882
2014-12-02 13:46:36 -08:00
Svet Ganov
eaaf0512fc Crash in print spooler when back pressed before content update complted.
We are updating the printed content asynchronously. If the user cancels
printing before the first update is complete the spooler components are
in a destroyed state but we attempt to handle the completed update resulting
in a crash. Now if printing is cancelled we ignore the update result.

bug:18525491

Change-Id: I1ef47a17de19896cba2c7a1dd2bfc205065e0a5a
2014-12-02 18:43:05 +00:00
Svet Ganov
c80814e70a Lockup in the print spooler.
A recent change modified the way we destroy the remote renderer from
asynchronous to synchronous. This caused problems since it was possible
that the remote rendering service is unbound while we are reading the
contents of a rendered page. As a result the reader was blocking on I/O
and the print spooler was getting into a locked state that required a
restart of its process.  Now the remote renderer is destroyed
asynchronously.

bug:18498626

Change-Id: I1312bf808f30430728b4038dd4be43c55d2be825
2014-11-24 22:12:34 +00:00
Svet Ganov
f6cd14dbc9 Print spooler crash when printing after a rotation.
1. Available printers are provided by a loader driven by the activity
   lifecycle. After a rotation of an app that does not handle rotation
   the print activity is destroyed in a delayed fashion. When another
   print task is started the loader of the destroed activity gets two
   cancellations, one when the activity is stopped and one when it is
   destroyed but when the second cancellation happens the loader has a
   bad state that it is loading while it is not and a NPE occurs.

2. If a rotation happens early before the print activity is fully initialized
   (there are asyncrconous operations that take place) we get a NPE as
   the print preview controller is not created yet.

3. A lockup of the print preview process occurs if the print print
   activity is destroyed after we initiated binding to the rendering
   service but before we receive the remote interface. In this case no
   remote service is received as exepcted since we already unbound from
   it resulting in a missed signal.

bug:18238590

Change-Id: I81817d81702f649ded97dfbab7d7bba28f22fa91
2014-11-22 09:28:38 -08:00
Svet Ganov
fce84f035c Crash apps that print malformed or password protected PDFs.
If apps are writing malformed content (typically not a PDF file) or if the
PDF content they provide to the print system is password protected, are now
crashed as both of these are app bugs.

bug:17636435

Change-Id: Ifce6a3199e587448dd38f6a84290a965c24b698b
2014-11-01 00:06:08 +00:00
Svetoslav
93134ce87e Merge "Save to a PDF file should look like print preview." into lmp-mr1-dev 2014-10-31 19:54:05 +00:00
Svetoslav
bec22beb99 Save to a PDF file should look like print preview.
When rendering a PDF file for print preview we take into account
the selected print options such as paper size, orientation, etc
without modifying the document. To print we send the doc in its
original form and the print options so the print service can apply
the necessary transforms in addition to the optional custom options
it supports. When saving to PDF we have to actually change the
document as we act as a print service.

bug:13545980

Change-Id: Icdcecf962bec6ff742cc6015df5af9d9086ce760
2014-10-31 10:41:34 -07:00
Svetoslav
7c053c1e41 Print preview disappearing if printer is changed.
This is a regression caused by my previous patch.

Change-Id: I80a0b4d880fd4e48e6a44fac303a4c8204e8ec0d
2014-10-29 13:50:42 -07:00
Svet Ganov
b32f04b785 Merge "Printing from two apps at the same time not working." into lmp-mr1-dev 2014-10-25 00:16:58 +00:00
Svet Ganov
99a82437ed Printing from two apps at the same time not working.
When printing from two apps at the same time the second print UI is
getting stuck. There were a couple of issues here:

AdapterView was not notifying for item selection if the data changes
after scheduling a dalayed selection notification and the notification
execution. The code assumed that a layout pass will occur and posponed
the notification after the layout pass but it is not guaranteed that
such a layout pass will occur. Now we delay only if a layout pass is
being scheduled.

Also when binding to the PDF rendering service the print spooler was
using the same intent and as a result two print activites were getting
the same renderer instance while they should get separate ones. Now
we use different data in the intent to ensure we get separate renderer
instances.

Change-Id: I6aa7c7b041957804b4273549dd837a6d70064efc
2014-10-24 17:02:32 -07:00
Svet Ganov
7cf7c36438 Merge "Crash in print spooler if printing app killed from recents." into lmp-mr1-dev 2014-10-24 20:32:19 +00:00
Svet Ganov
4237c92d85 Crash in print spooler if printing app killed from recents.
If the printing app with the print UI on top is killed from recents we get
a crash because: 1) the remote print document was not transitioned to a
failed state if the printing app dies (this is an unrecoverable failure);
2) the print preview controller was destroyed asyncronosly during which it
also asynchronously disconnects from the rendering service which however
happens after the system has already cleaned up all connections of the print
UI activity as it is being destoryed.

bug:18109386

Change-Id: If6200b14a8aa90622228bbb659e9c4962226f561
2014-10-24 13:01:54 -07:00
Svet Ganov
2916f658c9 Sometimes historical printers not properly ordered.
We order printers based on past usage. In some cases the ordering
does not work. The reason for that was an incorrect assumption that
the entries in an ArrayMap are ordered in the order they are added.

bug:18109283

Change-Id: Ie367e4ca5e6bd79f335a060074c9211054e3a931
2014-10-23 20:10:10 -07:00
Svet Ganov
9920a0dcf1 Merge "Set copies to one when saving to PDF." into lmp-mr1-dev 2014-10-23 23:17:04 +00:00
Svet Ganov
45e50e99cd Set copies to one when saving to PDF.
One can save only one copy to PDF. Showing more that one copy when saving
to PDF enven in a disabled input box is confusing to the user. We now set
the copies to one when the PDF printer is selected.

bug:17631303

Change-Id: Ia04d144efc899e7f3836c19349d9c87f3ae8f0f0
2014-10-23 19:43:54 +00:00
Svetoslav
0c8e15c016 am 60cdb909: am 0a1ffdb3: Merge "Handle if the printing app is killed while saving to PDF." into lmp-dev
* commit '60cdb909304f0d4b93a1a17228bdcc888f16cf41':
  Handle if the printing app is killed while saving to PDF.
2014-10-14 22:21:45 +00:00
Svetoslav
60cdb90930 am 0a1ffdb3: Merge "Handle if the printing app is killed while saving to PDF." into lmp-dev
* commit '0a1ffdb3f89705eeeb89349fcd31c82b2d15b0a5':
  Handle if the printing app is killed while saving to PDF.
2014-10-14 22:15:26 +00:00
Svetoslav
05e041b013 Handle if the printing app is killed while saving to PDF.
When saving to PDF we bring up the file picker UI which covers
the print UI. In this case the printing app may get killed as
it is not in the forground (the system is bound to the print
spooler so it cannot get killed). If that happens we are ending
up with an empty file. However, if the file chooser UI is up
we already have everything from the app we need and it dying
does not matter. This change takes care if ignoring printing
app death while saving to PDF.

bug:17922948

Change-Id: I10d808e3c3e93e850dbc2a948f2482381a887928
2014-10-14 14:16:12 -07:00
Svet Ganov
2eb7fadcd6 Custom print settings cannot change resolution.
bug:17677133

Change-Id: Ib8a24101f12d431fe221c1e91711d93a6a517273
2014-10-07 15:32:31 -07:00
Geoff Mendal
c1a064dd94 Import translations. DO NOT MERGE
Change-Id: I391b269b0d535fa7d8a4082cb0271b0aeb16a497
Auto-generated-cl: translation import
2014-10-06 10:56:58 -07:00
Geoff Mendal
f65288da06 Import translations. DO NOT MERGE
Change-Id: Ieb7aeaea1204f4ba7daf3abd7a30f647564807dd
Auto-generated-cl: translation import
2014-10-06 10:55:10 -07:00
Geoff Mendal
86dec04749 Import translations. DO NOT MERGE
Change-Id: I2100b649d1f2866cdc5ffd13f264afba347b6685
Auto-generated-cl: translation import
2014-10-06 10:54:01 -07:00
Svetoslav
59bb49fbf7 am 922fcc2f: Merge "Crash in print spooler if save to PDF selected early." into lmp-dev
* commit '922fcc2f9e2370b34672af0e91e5754c6f8d6da7':
  Crash in print spooler if save to PDF selected early.
2014-09-29 02:55:26 +00:00
Svetoslav
1fd7359038 am b179bed3: Merge "Fix carsh in print spooler if custom print setings return bad pages." into lmp-dev
* commit 'b179bed35302704bce809029ab424f919de351c3':
  Fix carsh in print spooler if custom print setings return bad pages.
2014-09-29 02:55:18 +00:00
Svetoslav
922fcc2f9e Merge "Crash in print spooler if save to PDF selected early." into lmp-dev 2014-09-28 21:00:23 +00:00
Svetoslav
e1dcb397d5 Crash in print spooler if save to PDF selected early.
The first issue is that the save to pdf button is enabled
before the first layout completed and at this point we do
not know anything about the document. The second is that
if a layout is in progress and we select save to pdf we
end up starting the documents UI twice and finishing the
second instance carshes the spooler.

bug:17676878

Change-Id: Id0b1f06e4d377347286c2dde09669d431441234b
2014-09-28 20:05:57 +00:00
Svetoslav
528424c26c Fix carsh in print spooler if custom print setings return bad pages.
The custom settings activity of a print serivce can change the selected
pages and the spooler was not checking whether the returned pages were
valid leading to a crash.

bug:17678553

Change-Id: Id8ea3d482d2909b97a06752d61b416dfe5948483
2014-09-28 20:05:45 +00:00
Svetoslav
9aacf5d3f2 am 299a89b5: Merge "Print spooler should not crash if fed non-PDF content." into lmp-dev
* commit '299a89b50f1268f3c4cd0e58727f7d7805b573b2':
  Print spooler should not crash if fed non-PDF content.
2014-09-24 20:33:54 +00:00
Svetoslav
d23bfa9d42 Print spooler should not crash if fed non-PDF content.
It is possible that a buggy app breaks the contract and provides
content to be printed in format other than PDF. This was leading
to a crash in the print spooler. This change fixes the crash and
shows a user friendly error message.

bug:17642690

Change-Id: I5a4acb06080a152562655da6851467b3e71d8658
2014-09-24 13:22:35 -07:00
Svetoslav
f61ed942cd am 15c86a84: Merge "Missing pages in print preview when scorolling." into lmp-dev
* commit '15c86a84a5b595b43eecec611de22e6bd0c0eea4':
  Missing pages in print preview when scorolling.
2014-09-24 15:33:58 +00:00
Svetoslav
2bac6129a4 Merge "Missing pages in print preview when scorolling." into lmp-dev 2014-09-24 15:24:25 +00:00
Svetoslav
237806bbc5 Missing pages in print preview when scorolling.
It is possible that two providers for the same page are assigned
to two preview views despite temporariliy while rebinding. We were
however releasing the provider from the view which is being bound
if not for the same page which as a result was cancelling rendering
of this page which is provided to another view via another provider.
Hence, having an empty page. Removed the unnecessary code to release
a provider when binding the view - release is happening only if the
view holder is recycled.

bug:17515670

Change-Id: I197438c16cfdb363f521cd1320f154da54eea5f5
2014-09-23 21:29:48 -07:00
Svetoslav
822a58aad3 am 857f8013: Merge "Fix ANR in print spooler." into lmp-dev
* commit '857f80134d6c23894f5589457883c57137b2ed27':
  Fix ANR in print spooler.
2014-09-24 00:00:13 +00:00
Svetoslav
24ef6e43db am ea5d75d8: Merge "Print spooler crash on back before first layout is complete." into lmp-dev
* commit 'ea5d75d807b379592f3bfd6ccd4cb43d02f72f49':
  Print spooler crash on back before first layout is complete.
2014-09-24 00:00:08 +00:00
Svetoslav
09eb0b2033 Merge "Fix ANR in print spooler." into lmp-dev 2014-09-23 23:53:21 +00:00
Svetoslav
5668348138 Fix ANR in print spooler.
Saving to PDF a subset of the pages requires trimming the
undesired pages and when this is done writing the ready doc
to a URI. To write the file to URI we have to obtain it but
it is aquired by the shredding task and never released. Now
we are releasing the document immediately after trimming it.

bug:17631301

Change-Id: I4db7966c65c75f0f14c3cb52fd83b4d8fd5a4687
2014-09-23 16:25:54 -07:00
Svetoslav
254361f136 Print spooler crash on back before first layout is complete.
If the user presses back before the remote print document
update has completed we get a crash. The reason is that
after the update completion we were trying to finish the
activity if we are in a cancelled state but this is not
needed as we aready handled the back key so we will finish.
Handling finish twice was creating the problem as classes
with lifecycles are not designed to be used after being
finished. In particular, we were calling doFinish() twice.

bug:17630561

Change-Id: If418f237a2def7c8e4a072ac8826283f4dd7fc85
2014-09-23 15:54:24 -07:00
Svetoslav
b889173558 am e9456781: Merge "Loosen the constraint for releasing a shared file." into lmp-dev
* commit 'e9456781c0b4d6ccc70a5378ecd802fd28554796':
  Loosen the constraint for releasing a shared file.
2014-09-22 21:51:24 +00:00
Svetoslav
cf3a86b559 Loosen the constraint for releasing a shared file.
In the spooler we have the renderer reading a file to visualize
content and the app writing a file to produce the content. Since
we have to swap the file under the renderer we have a mutex file
provider that both parties can request, use when released, and
release when required. This enables us to request the file which
closes the renderer and when the renderer is closed ask the app
to write some more pages, then open the renderer, and so on. The
mutex file provider was throwing of a thread that does not own
the file thries to relase it which is not needed, this should be
just a nop.

bug:17607134

Change-Id: Id6a2ce92d70077f57978b95315648faf02c13c68
2014-09-22 13:48:44 -07:00
Baligh Uddin
d5270550b1 Import translations. DO NOT MERGE
Change-Id: I87cc837c719968aa778af92a4f119a266d2c2c42
Auto-generated-cl: translation import
2014-09-20 12:59:23 -07:00
Baligh Uddin
78ec95e714 Import translations. DO NOT MERGE
Change-Id: Ib08e8991a092d8404352d9709d837be2eb392b55
Auto-generated-cl: translation import
2014-09-20 12:56:55 -07:00
Svetoslav
518b9dd923 am a2201272: Merge "Fix a print spooler crash when printing." into lmp-dev
* commit 'a2201272b5b27f3ac9cf90d6332e81fb474c1dbb':
  Fix a print spooler crash when printing.
2014-09-19 21:49:22 +00:00