Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92c29360 authored by Philip P. Moltmann's avatar Philip P. Moltmann Committed by Android (Google) Code Review
Browse files

Merge "Cancel print job if PrintActivity was finished before spooler could be connected."

parents 40dedd5a cf5b777c
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -265,8 +265,15 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
                new Runnable() {
            @Override
            public void run() {
                if (isFinishing()) {
                    // onPause might have not been able to cancel the job, see PrintActivity#onPause
                    // To be sure, cancel the job again. Double canceling does no harm.
                    mSpoolerProvider.getSpooler().setPrintJobState(mPrintJob.getId(),
                            PrintJobInfo.STATE_CANCELED, null);
                } else {
                    onConnectedToPrintSpooler(adapter);
                }
            }
        });
    }

@@ -353,8 +360,10 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat

        if (mState == STATE_INITIALIZING) {
            if (isFinishing()) {
                if (spooler != null) {
                    spooler.setPrintJobState(mPrintJob.getId(), PrintJobInfo.STATE_CANCELED, null);
                }
            }
            super.onPause();
            return;
        }