From 23d3361e1747ee286157f9c61c3d02e6e20cac58 Mon Sep 17 00:00:00 2001 From: Svetoslav Date: Tue, 16 Sep 2014 10:50:52 -0700 Subject: [PATCH] Do not change fragments if print activity finishing. 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 --- .../src/com/android/printspooler/ui/PrintActivity.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java b/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java index 693e5ac5a2723..39852850f83f3 100644 --- a/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java +++ b/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java @@ -816,6 +816,9 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat } private void ensureProgressUiShown() { + if (isFinishing()) { + return; + } if (mUiState != UI_STATE_PROGRESS) { mUiState = UI_STATE_PROGRESS; mPrintPreviewController.setUiShown(false); @@ -825,6 +828,9 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat } private void ensurePreviewUiShown() { + if (isFinishing()) { + return; + } if (mUiState != UI_STATE_PREVIEW) { mUiState = UI_STATE_PREVIEW; mPrintPreviewController.setUiShown(true); @@ -833,6 +839,9 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat } private void ensureErrorUiShown(CharSequence message, int action) { + if (isFinishing()) { + return; + } if (mUiState != UI_STATE_ERROR) { mUiState = UI_STATE_ERROR; mPrintPreviewController.setUiShown(false);