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

Commit c383eea8 authored by Philip P. Moltmann's avatar Philip P. Moltmann Committed by android-build-merger
Browse files

Merge "Prevent printing from finishing activity." into nyc-dev am: 41304f47 am: a9c65ffb

am: 7db07e57

* commit '7db07e57':
  Prevent printing from finishing activity.

Change-Id: Ibbe7d4f14e109c51fbd239b1998f8f0f580a8ed8
parents 4f695172 7db07e57
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -778,6 +778,12 @@ public final class PrintManager {

        public PrintDocumentAdapterDelegate(Activity activity,
                PrintDocumentAdapter documentAdapter) {
            if (activity.isFinishing()) {
                // The activity is already dead hence the onActivityDestroyed callback won't be
                // triggered. Hence it is not save to print in this situation.
                throw new IllegalStateException("Cannot start printing for finishing activity");
            }

            mActivity = activity;
            mDocumentAdapter = documentAdapter;
            mHandler = new MyHandler(mActivity.getMainLooper());