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

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

Merge "Init and clean up printer registry independat of state."

parents 7e444c00 51dbc8ec
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -339,7 +339,7 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
    @Override
    public void onStart() {
        super.onStart();
        if (mState != STATE_INITIALIZING && mCurrentPrinter != null) {
        if (mPrinterRegistry != null && mCurrentPrinter != null) {
            mPrinterRegistry.setTrackedPrinter(mCurrentPrinter.getId());
        }
        MetricsLogger.count(this, "print_preview", 1);
@@ -386,7 +386,10 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
    @Override
    protected void onStop() {
        mPrinterAvailabilityDetector.cancel();

        if (mPrinterRegistry != null) {
            mPrinterRegistry.setTrackedPrinter(null);
        }

        super.onStop();
    }
@@ -1925,9 +1928,12 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
    }

    private void doFinish() {
        if (mPrinterRegistry != null) {
            mPrinterRegistry.setTrackedPrinter(null);
        }

        if (mState != STATE_INITIALIZING) {
            mProgressMessageController.cancel();
            mPrinterRegistry.setTrackedPrinter(null);
            mSpoolerProvider.destroy();
            mPrintedDocument.finish();
            mPrintedDocument.destroy();