summaryrefslogtreecommitdiffstats
path: root/packages/PrintSpooler/src
diff options
context:
space:
mode:
authorSvetoslav <svetoslavganov@google.com>2014-10-14 14:14:49 -0700
committerSvetoslav <svetoslavganov@google.com>2014-10-14 14:16:12 -0700
commit05e041b013d8750a66787f5f7eb77c7ec95a670f (patch)
tree1384b9ef62c1cdd26268028b1768f044879c8be7 /packages/PrintSpooler/src
parenta89ac60e25eb77b4c605fc1a40c96416b199bea5 (diff)
downloadframeworks_base-05e041b013d8750a66787f5f7eb77c7ec95a670f.zip
frameworks_base-05e041b013d8750a66787f5f7eb77c7ec95a670f.tar.gz
frameworks_base-05e041b013d8750a66787f5f7eb77c7ec95a670f.tar.bz2
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
Diffstat (limited to 'packages/PrintSpooler/src')
-rw-r--r--packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java b/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java
index 84ada6f..20254f0 100644
--- a/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java
+++ b/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java
@@ -286,7 +286,9 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
mFileProvider, new RemotePrintDocument.RemoteAdapterDeathObserver() {
@Override
public void onDied() {
- if (isFinishing()) {
+ // If we are finishing or we are in a state that we do not need any
+ // data from the printing app, then no need to finish.
+ if (isFinishing() || (isFinalState(mState) && !mPrintedDocument.isUpdating())) {
return;
}
setState(STATE_PRINT_CANCELED);