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

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

Merge "Do not transform again on crash"

parents 2acbf6ce 5c7d8faf
Loading
Loading
Loading
Loading
+29 −21
Original line number Diff line number Diff line
@@ -3117,6 +3117,8 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat

        private final Consumer<String> mCallback;

        private boolean mIsTransformationStarted;

        public DocumentTransformer(Context context, PrintJobInfo printJob,
                MutexFileProvider fileProvider, PrintAttributes attributes,
                Consumer<String> callback) {
@@ -3144,6 +3146,9 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat

        @Override
        public void onServiceConnected(ComponentName name, IBinder service) {
            // We might get several onServiceConnected if the service crashes and restarts.
            // mIsTransformationStarted makes sure that we only try once.
            if (!mIsTransformationStarted) {
                final IPdfEditor editor = IPdfEditor.Stub.asInterface(service);
                new AsyncTask<Void, Void, String>() {
                    @Override
@@ -3167,6 +3172,9 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat
                        mCallback.accept(error);
                    }
                }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);

                mIsTransformationStarted = true;
            }
        }

        @Override