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

Commit 05933ef7 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: 45821685

* commit '45821685':
  Prevent printing from finishing activity.

Change-Id: I1b153cad434bcde641660c18c040afc3f7badac5
parents 1b4e9ed2 45821685
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());