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

Commit 3d6fd9af authored by naman14's avatar naman14 Committed by Steve Kondik
Browse files

Fix IllegalStateException in Printspooler

Open webpage in chrome(or any thing to print) and click print and then press
back, throws a IllegalStateException.
Currently in onDestroy, doFinish() is called which further calls
unbindService()in PrintSpoolerProvider,but since service has already been
unbinded,it throws a Service not registered error.

Change-Id: If58a951e9e66a4048f0ece3100aabe49cee0ab84
parent 6d6d1393
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -372,7 +372,17 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat

    @Override
    protected void onDestroy() {
        doFinish();
        if (mState != STATE_INITIALIZING) {
            mPrintPreviewController.destroy(new Runnable() {
                @Override
                public void run() {
                    finish();
                }
            });
        } else {
            finish();
        }

        super.onDestroy();
    }