summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorSvet Ganov <svetoslavganov@google.com>2014-11-26 04:09:27 -0800
committerSvetoslav Ganov <svetoslavganov@google.com>2014-12-02 18:43:05 +0000
commiteaaf0512fcbf03b926cdbbbb7f54df474ecf861a (patch)
treeb2f4476afd27fd580d47f5237a17bf2a240494a5 /packages
parent5aeed158df65847edac69761630dcd66b8f66eaa (diff)
downloadframeworks_base-eaaf0512fcbf03b926cdbbbb7f54df474ecf861a.zip
frameworks_base-eaaf0512fcbf03b926cdbbbb7f54df474ecf861a.tar.gz
frameworks_base-eaaf0512fcbf03b926cdbbbb7f54df474ecf861a.tar.bz2
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
Diffstat (limited to 'packages')
-rw-r--r--packages/PrintSpooler/src/com/android/printspooler/model/PageContentRepository.java4
-rw-r--r--packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java4
2 files changed, 7 insertions, 1 deletions
diff --git a/packages/PrintSpooler/src/com/android/printspooler/model/PageContentRepository.java b/packages/PrintSpooler/src/com/android/printspooler/model/PageContentRepository.java
index 90875c0..ea6281d 100644
--- a/packages/PrintSpooler/src/com/android/printspooler/model/PageContentRepository.java
+++ b/packages/PrintSpooler/src/com/android/printspooler/model/PageContentRepository.java
@@ -486,7 +486,9 @@ public final class PageContentRepository {
protected Void doInBackground(Void... params) {
synchronized (mLock) {
try {
- mRenderer.closeDocument();
+ if (mRenderer != null) {
+ mRenderer.closeDocument();
+ }
} catch (RemoteException re) {
/* ignore */
}
diff --git a/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java b/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java
index 352b545..f3a5c95 100644
--- a/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java
+++ b/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java
@@ -487,6 +487,10 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
requestCreatePdfFileOrFinish();
} break;
+ case STATE_PRINT_CANCELED: {
+ updateOptionsUi();
+ } break;
+
default: {
updatePrintPreviewController(document.changed);