summaryrefslogtreecommitdiffstats
path: root/packages/PrintSpooler/src
Commit message (Collapse)AuthorAgeFilesLines
* Avoid NPE in printspooler when changing languageMasaaki Iwaguchi2016-07-081-3/+5
| | | | | | | | | | PrintActivity is recreated when the language setting is changed. As a result of the recreation mCurrentPrinter is null, which causes a NullPointerException when onActivityResult() is called. The issue is solved with a simple null check. Change-Id: Ic58f0ca01577d2ec02d494739f3bc2f06240dd44
* The process PrintSpooler:renderer crashes in libpdfium.so.suncx2015-11-071-4/+1
| | | | | | | | | In PdfManipulationService.java, PdfEditorImpl shouldn't open the same ParcelFileDescriptor before PdfRendererImpl close it. In this case, add a lock to synchronize the two threads. Change-Id: Ia405b3d4fbccf56982212a21e4a586f69da0ddb5 Signed-off-by: Zhiquan Liu <zhiquan.liu@intel.com>
* Fix IllegalStateException in Printspoolernaman142015-10-261-1/+11
| | | | | | | | | | Open webpage in chrome(or any thing to print) and click print and then press back, throws a IllegalStateException. Currently in onDestroy, doFinish() is called which further calls unbindService()in PrintSpoolerProvider,but since service has already been unbinded,it throws a Service not registered error. Change-Id: If58a951e9e66a4048f0ece3100aabe49cee0ab84
* printspooler: Print view crash.lingyan.wang2015-10-261-0/+6
| | | | | | | | | | 1.put a txt file into device. 2.Go to File Manager->long press the txt file->Print->Long press home key->Clear all 3.Go to File Manager->long press the txt file->Print The result: Print view crash. Change-Id: I46a71b8e1196f69b6b40f38b418a88d794918429
* Instrument printing service for metrics collection.Chris Wren2015-07-302-0/+6
| | | | | Bug: 22837316 Change-Id: I8bf62940f5eb495d8d7a10df958d9bc8ad76662a
* Pass correct extras to the custom print options activitySvet Ganov2015-07-251-1/+1
| | | | | | bug:22734138 Change-Id: Iea1bc32c3e863072b2021b823bef2cefa54fa540
* Propagete document meta-data to custom print UI.Svet Ganov2015-06-111-0/+2
| | | | Change-Id: I3f122224e1b311a222969253ae0336177989a414
* Pass charset to XmlPullParser.setInput instead of nullWojciech Staszkiewicz2015-05-142-4/+6
| | | | | | | | | Passing null to XmlPullParser.setInput forces it to do additional work, which can be easily avoided if we know the charset beforehand. bug: b/20849543 Change-Id: Iaff97be9df2d0f99d7af8f19f65934439c9658e2
* Replace usages of deprecated Resources.getColor() and getColorStateList()Alan Viverette2015-03-182-6/+6
| | | | Change-Id: I8f64fe6c4c44a92ff6d07250223ba590a1d691b0
* Remove unused imports in frameworks/base.John Spurlock2015-02-281-2/+0
| | | | Change-Id: I031443de83f93eb57a98863001826671b18f3b17
* First quick implementation of auto assist data.Dianne Hackborn2015-02-061-2/+5
| | | | | | | | | | | | | | Introduce new AssistData class that contains all data the framework automatically generates for assist. Currently populated with a very simple tree structure representing the app's view hierarchy. Reworked how we populate the class name for accessibility info, so this is provided through a new method call on View that subclasses can override. This method is also used to populate the class name in AssistData. Change-Id: Ibd0acdc8354727d4291473283b5e4b70894905dc
* Add duplex mode support.Svetoslav2015-02-042-1/+118
| | | | | | | | | This change adds support for duplex printing. The print UI now has a duplex option which allows the user to choose one of the supported duplex options by the currently selected printer. The chosen duplex mode is propaged to the print service that manages this printer. Change-Id: I807ba9da2723531535c0e1e33f2f4e1b503a54b0
* Crash in print spooler when back pressed before content update complted.Svet Ganov2014-12-022-1/+7
| | | | | | | | | | | 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
* Lockup in the print spooler.Svet Ganov2014-11-244-13/+33
| | | | | | | | | | | | | | 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
* Print spooler crash when printing after a rotation.Svet Ganov2014-11-223-71/+109
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Crash apps that print malformed or password protected PDFs.Svet Ganov2014-11-016-35/+113
| | | | | | | | | 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
* Merge "Save to a PDF file should look like print preview." into lmp-mr1-devSvetoslav2014-10-313-15/+134
|\
| * Save to a PDF file should look like print preview.Svetoslav2014-10-313-15/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Print preview disappearing if printer is changed.Svetoslav2014-10-291-1/+2
| | | | | | | | | | | | This is a regression caused by my previous patch. Change-Id: I80a0b4d880fd4e48e6a44fac303a4c8204e8ec0d
* | Merge "Printing from two apps at the same time not working." into lmp-mr1-devSvet Ganov2014-10-251-0/+2
|\ \
| * | Printing from two apps at the same time not working.Svet Ganov2014-10-241-0/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Crash in print spooler if printing app killed from recents." into ↵Svet Ganov2014-10-246-79/+51
|\ \ | | | | | | | | | lmp-mr1-dev
| * | Crash in print spooler if printing app killed from recents.Svet Ganov2014-10-246-79/+51
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Sometimes historical printers not properly ordered.Svet Ganov2014-10-231-13/+7
|/ | | | | | | | | | 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
* Merge "Set copies to one when saving to PDF." into lmp-mr1-devSvet Ganov2014-10-231-1/+5
|\
| * Set copies to one when saving to PDF.Svet Ganov2014-10-231-1/+5
| | | | | | | | | | | | | | | | | | 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
* | am 60cdb909: am 0a1ffdb3: Merge "Handle if the printing app is killed while ↵Svetoslav2014-10-141-1/+3
|\ \ | |/ |/| | | | | | | | | saving to PDF." into lmp-dev * commit '60cdb909304f0d4b93a1a17228bdcc888f16cf41': Handle if the printing app is killed while saving to PDF.
| * Handle if the printing app is killed while saving to PDF.Svetoslav2014-10-141-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Custom print settings cannot change resolution.Svet Ganov2014-10-071-31/+51
|/ | | | | | bug:17677133 Change-Id: Ib8a24101f12d431fe221c1e91711d93a6a517273
* Merge "Crash in print spooler if save to PDF selected early." into lmp-devSvetoslav2014-09-281-1/+5
|\
| * Crash in print spooler if save to PDF selected early.Svetoslav2014-09-281-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Fix carsh in print spooler if custom print setings return bad pages.Svetoslav2014-09-281-1/+26
|/ | | | | | | | | | 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
* Print spooler should not crash if fed non-PDF content.Svetoslav2014-09-242-5/+5
| | | | | | | | | | | 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
* Merge "Missing pages in print preview when scorolling." into lmp-devSvetoslav2014-09-241-4/+0
|\
| * Missing pages in print preview when scorolling.Svetoslav2014-09-231-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Fix ANR in print spooler." into lmp-devSvetoslav2014-09-231-0/+1
|\ \
| * | Fix ANR in print spooler.Svetoslav2014-09-231-0/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | 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
* | Print spooler crash on back before first layout is complete.Svetoslav2014-09-232-5/+1
|/ | | | | | | | | | | | | | | 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
* Loosen the constraint for releasing a shared file.Svetoslav2014-09-221-1/+1
| | | | | | | | | | | | | | | | | 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
* Fix a print spooler crash when printing.Svetoslav2014-09-194-18/+33
| | | | | | | | | | | | The spooler communicates with he remote PDF renderer asynchronously. When print is confirmed we close the renderer, destroy it, and unbind from its service. If we unbind from the service after the print activiy is finished we get a crash. The bug was that we did not wait until we disconnect from the remote renderer before finishing the print activity. bug:17583115 Change-Id: I55b0135f9c5658b3a4fda2901b8b3bdef044e211
* Print UI stuck when backing out of documents UI.Svetoslav2014-09-181-2/+2
| | | | | | | | | | | | When user chooses to save to PDF we open the document chooser UI. Now if the user now backs to the print UI without choosing a file, the print UI has all options disabled and the back button does not work - the user is stuck. This is because we were not transitioning the print UI in the correct state. bug:17557454 Change-Id: I385129e106ed41564b89137ca54d409127ba8ff0
* Page content sometimes missing in preview when scrolling.Svetoslav2014-09-172-31/+5
| | | | | | | | | | | | | | | | | | Removed the restriction for the page content providers to be singletons as the RecyclerView may hold on views with providers and ask us to bind other views for the same page. Note that the views that RecyclerView is holding will be soon rebound or recycled just they are not at the time we bind other views for the same position. We were guarding against this but caused some pages not appearing sometimes on scrolling. Also now keeping the media size and magins of recycled page view (will be updated if needed on rebinding) or avoid changes of the background to null as setting it to not null later causes an undesired layout pass. bug:17537922 Change-Id: If029f6c413e15d4f5c1ba1ac5e4d52ad2cad5904
* Page content sometimes disappears when scrolling a long doc in print preview.Svetoslav2014-09-175-12/+10
| | | | | | | | | | | | | The operations of the remote renderer have to be performed in order, open, render some pages, close. One of the tasks was executed on the wrong executor resuling in a race and an occassional bad state. Also fixed a NPE if the preview list is flinged and then the user presses back. bug:17537922 Change-Id: I5048078ba2b875a2a8335f3a4324afaa34d014a2
* Merge "Print preview disappearing on screen off/on." into lmp-devSvetoslav2014-09-161-0/+9
|\
| * Print preview disappearing on screen off/on.Svetoslav2014-09-161-0/+9
| | | | | | | | | | | | | | | | | | | | We were not clearing the tracked printer when the print activity is paused and then not setting the tracked printer when the activity is resumed. bug:17525271 Change-Id: Ib0fb29006bfcf5ad03dce24b3407cd96dc421442
* | Do not change fragments if print activity finishing.Svetoslav2014-09-161-0/+9
|/ | | | | | | | | | | It is possible that we try to switch framents after the print activity finish method is called. In this state the activity is going away and trying to perform a fragment operation throws. Now if we are finishing no fragment opration is performed. bug:17520007 Change-Id: I0dd935d3cdaeddca31fccf49bd5de97e878abb9d
* Merge "Missing or wrong pages in preview when scorlling large docs." into ↵Svetoslav2014-09-162-8/+12
|\ | | | | | | lmp-dev
| * Missing or wrong pages in preview when scorlling large docs.Svetoslav2014-09-152-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | The bound pages in the adapter were not properly tracked, more specifically we did not remove pages from the bound set ending up in a bad state. Also when the printer changes and if the new one has different page size the content disappears due to us not notifying for the data set change. bug:17515670 Change-Id: Iac74e864609012f6804584fa133e87c27dc186a5
* | Merge "Page shredder callback invoked on the wrong thread." into lmp-devSvetoslav2014-09-161-12/+12
|\ \
| * | Page shredder callback invoked on the wrong thread.Svetoslav2014-09-151-12/+12
| |/ | | | | | | | | | | | | | | | | | | The code executed in the shredder completion callback must be called on the main thread but instead it was called on another one. This led to a crash. bug:17514533 Change-Id: Id9e86d38a90fedadc60f967b193470fd83eb3362