summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Svetoslav <svetoslavganov@google.com> 2014-09-29 04:17:32 +0000
committer Android Git Automerger <android-git-automerger@android.com> 2014-09-29 04:17:32 +0000
commit903365a90100930fd33c9ee6b5ff4f416d36c84a (patch)
treec7add6ec04ef143a1c6dda407dcc132088109232
parent90f2f122865e7334a76363829c01c34d805a9433 (diff)
parent59bb49fbf72defb41561f1e25e5167092a6230c7 (diff)
am 59bb49fb: am 922fcc2f: Merge "Crash in print spooler if save to PDF selected early." into lmp-dev
* commit '59bb49fbf72defb41561f1e25e5167092a6230c7': Crash in print spooler if save to PDF selected early.
-rw-r--r--packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java6
1 files changed, 5 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 72916ea3d20c..84ada6f45d88 100644
--- a/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java
+++ b/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java
@@ -566,6 +566,9 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
}
private void startCreateDocumentActivity() {
+ if (!isResumed()) {
+ return;
+ }
PrintDocumentInfo info = mPrintedDocument.getDocumentInfo().info;
if (info == null) {
return;
@@ -1372,7 +1375,8 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
mPrintButton.setImageResource(R.drawable.ic_menu_savetopdf);
mPrintButton.setContentDescription(getString(R.string.savetopdf_button));
}
- if ((mRangeOptionsSpinner.getSelectedItemPosition() == 1
+ if (!mPrintedDocument.getDocumentInfo().laidout
+ ||(mRangeOptionsSpinner.getSelectedItemPosition() == 1
&& (TextUtils.isEmpty(mPageRangeEditText.getText()) || hasErrors()))
|| (mRangeOptionsSpinner.getSelectedItemPosition() == 0
&& (mPrintedDocument.getDocumentInfo() == null || hasErrors()))) {