Skip to content

Commit 922fcc2

Browse files
sganovAndroid (Google) Code Review
authored andcommitted
Merge "Crash in print spooler if save to PDF selected early." into lmp-dev
2 parents b179bed + e1dcb39 commit 922fcc2

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,9 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
566566
}
567567

568568
private void startCreateDocumentActivity() {
569+
if (!isResumed()) {
570+
return;
571+
}
569572
PrintDocumentInfo info = mPrintedDocument.getDocumentInfo().info;
570573
if (info == null) {
571574
return;
@@ -1372,7 +1375,8 @@ void updateOptionsUi() {
13721375
mPrintButton.setImageResource(R.drawable.ic_menu_savetopdf);
13731376
mPrintButton.setContentDescription(getString(R.string.savetopdf_button));
13741377
}
1375-
if ((mRangeOptionsSpinner.getSelectedItemPosition() == 1
1378+
if (!mPrintedDocument.getDocumentInfo().laidout
1379+
||(mRangeOptionsSpinner.getSelectedItemPosition() == 1
13761380
&& (TextUtils.isEmpty(mPageRangeEditText.getText()) || hasErrors()))
13771381
|| (mRangeOptionsSpinner.getSelectedItemPosition() == 0
13781382
&& (mPrintedDocument.getDocumentInfo() == null || hasErrors()))) {

0 commit comments

Comments
 (0)